id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
170844 | import math
import random
from functools import partial
from typing import Callable, Optional, Tuple
import flax.linen as nn
import jax
import jax.numpy as jnp
from flax.core.frozen_dict import FrozenDict, unfreeze
from flax.linen import combine_masks, make_causal_mask
from flax.linen.attention import dot_product_atte... | StarcoderdataPython |
162575 | <reponame>simpeg-research/iris-mt-scratch
"""
revamping of TTF.m --> TTF.py
This uses xarray for the transfer function
This tracks the input_channels, output_channels,
At initialization we will know:
-input channels (iterable of channel objects)
-output_channels (iterable of channel objects)
-the relevant frequency ba... | StarcoderdataPython |
1625875 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
import os
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') as reqs_file:... | StarcoderdataPython |
180127 | #!/usr/bin/env python
#test client for joint_states_listener
import roslib
roslib.load_manifest('race_joint_states_listener')
import rospy
from race_joint_states_listener.srv import ReturnJointStates
import time
import sys
def call_return_joint_states(joint_names):
rospy.wait_for_service("return_joint_states")
... | StarcoderdataPython |
98781 | import os
from PolTools.utils.make_random_filename import generate_random_filename
from PolTools.utils.verify_bed_file import verify_bed_files
def run_coverage(regions_filename, sequencing_filename, output_filename='', flags=None):
"""
Runs strand specific bedtools coverage to get the number of counts in the... | StarcoderdataPython |
3220746 | import gdb
import config
import midas_utils
from execution_context import ExecutionContext
def response(success,
message,
result,
type=None,
variableReference=0,
namedVariables=None,
indexedVariables=None,
memoryReference=None)... | StarcoderdataPython |
31306 | <reponame>Vladimir-Antonovich/cloudify-vsphere-plugin
# Copyright (c) 2014-2020 Cloudify Platform Ltd. 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... | StarcoderdataPython |
1673288 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
wakatime.projects.mercurial
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information about the mercurial project for a given file.
:copyright: (c) 2013 <NAME>.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
import sys
from .base import BaseProjec... | StarcoderdataPython |
1774973 | <filename>topics/functions/variable-scope.py
name = 'Tonda'
def get_name():
print(f'{name} (inside)')
name = 'Jolana'
print(f'{name} (before call)')
get_name()
print(f'{name} (after call)')
| StarcoderdataPython |
3211260 | #!/usr/bin/env python
import os
import select
from subprocess import Popen
from flask import Flask, request, render_template, redirect, url_for
APP = Flask(__name__)
Popen(['rm mellon_fifo'], shell=True).wait() #remove old FIFO pipe
os.mkfifo("mellon_fifo")
mellon_fifo = None
mellon_fs = None
@APP.route('/', methods... | StarcoderdataPython |
1655132 | <gh_stars>10-100
#!/usr/local/bin/python
"""
Author: <NAME>
Contact: <EMAIL>
Testing:
import dash_client
mpd_file = <MPD_FILE>
dash_client.playback_duration(mpd_file, 'http://192.168.127.12:8005/')
From commandline:
python dash_client.py -m "http://192.168.127.12:8006/media/mpd... | StarcoderdataPython |
1609566 | import unittest
from openvpn_api.models import VPNModelBase
import netaddr # type: ignore
class ModelStub(VPNModelBase):
def parse_raw(cls, raw: str):
return None
class TestModelBase(unittest.TestCase):
def test_parse_string(self):
self.assertIsNone(ModelStub._parse_string(None))
s... | StarcoderdataPython |
3311036 | <filename>riccipy/metrics/kasner_1.py
"""
Name: <NAME>
Coordinates: Cartesian
Symmetry: Axial
"""
from sympy import Rational, diag, symbols
coords = symbols("t x y z", real=True)
variables = ()
functions = ()
t, x, y, z = coords
metric = diag(-1, t ** Rational(4, 3), t ** Rational(4, 3), t ** Rational(-2, 3))
| StarcoderdataPython |
55534 | import theano
import numpy
# CRF implementation based on Lample et al.
# "Neural Architectures for Named Entity Recognition"
floatX=theano.config.floatX
def log_sum(x, axis=None):
x_max_value = x.max(axis=axis)
x_max_tensor = x.max(axis=axis, keepdims=True)
return x_max_value + theano.tensor.log(theano.t... | StarcoderdataPython |
3233753 | #!/usr/bin/env python
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
def setup():
from setuptools import setup
setup(
name='xData',
version='1.0.0... | StarcoderdataPython |
3381243 | import torch
import torch.nn as nn
import torch.nn.functional as F
def _reset_parameters(layers):
for layer in layers:
layer.weight.data.uniform_(-3e-3,3e-3)
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_size, action_size, seed, fc_layers=[256,64]):
"""Ini... | StarcoderdataPython |
191153 | <filename>Python_PyPal_PM/PyPoll/mainpypoll.py
# Module for reading CSV files
import csv
#input_file
csv_path = ("Resources/election_data.csv")
#output_file
txt_path = ("Output/election_data.txt")
# Creating empty lists to iterate through the rows and get total values
total_votes = []
list_candidates = []
# Reading o... | StarcoderdataPython |
1728494 | from __future__ import annotations
from dataclasses import dataclass
from typing import Optional
from colorama import Fore
from clin.models.auth import ReadOnlyAuth
from clin.models.shared import Cleanup, Category, Entity, Kind, Audience, Partitioning
@dataclass
class OutputEventType:
category: Category
ow... | StarcoderdataPython |
187526 | <filename>benchmarks/linear_algebra/kernels/mvt/mvt.py
# Copyright 2021 Universidade da Coruña
#
# 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 |
3201599 | '''
inventoryanalytics: a Python library for Inventory Analytics
Author: <NAME>
MIT License
Copyright (c) 2018 <NAME>
'''
import unittest
import inventoryanalytics.lotsizing.deterministic.constant.eoq as eoq
import numpy as np
class TestEOQ(unittest.TestCase):
def setUp(self):
instance = {"K": 3.2, ... | StarcoderdataPython |
3269953 | <reponame>taliamax/uosu-petition<gh_stars>1-10
from server.controllers.firestore import FirestoreDriver
import json
def main():
db = FirestoreDriver()
result = {}
client = db.database_client
documents = client.stream()
for snapshot in documents:
result[snapshot.id] = snapshot.to_dict()
... | StarcoderdataPython |
9101 | <reponame>Cyberdeep/archerysec
# _
# /\ | |
# / \ _ __ ___| |__ ___ _ __ _ _
# / /\ \ | '__/ __| '_ \ / _ \ '__| | | |
# / ____ \| | | (__| | | | __/ | | |_| |
# /_/ \_\_| \___|_| |_|\___|_| \__, |
# __/ |
# ... | StarcoderdataPython |
1737422 | <reponame>danmcelroy/VoSeq
from django.contrib.auth.models import User
from django.contrib.postgres.fields import JSONField
from django.db import models
class Dataset(models.Model):
user = models.ForeignKey(User, null=True, on_delete=models.SET_NULL)
created = models.DateTimeField(auto_now_add=True)
compl... | StarcoderdataPython |
3316469 | <reponame>nro2/godirect-examples<filename>python/gdx_getting_started_9.py
import sys
import time
from gdx import gdx #the gdx function calls are from a gdx.py file inside the gdx folder.
gdx = gdx.gdx()
gdx.open_usb()
info = gdx.sensor_info()
chan = info[0][0]
gdx.select_sensors() ... | StarcoderdataPython |
139028 | pkgname = "evolution-data-server"
pkgver = "3.44.0"
pkgrel = 0
build_style = "cmake"
# TODO: libgdata
configure_args = [
"-DENABLE_GOOGLE=OFF", "-DWITH_LIBDB=OFF",
"-DSYSCONF_INSTALL_DIR=/etc", "-DENABLE_INTROSPECTION=ON",
"-DENABLE_VALA_BINDINGS=ON",
]
hostmakedepends = [
"cmake", "ninja", "pkgconf", "... | StarcoderdataPython |
1666479 | <reponame>VlachosGroup/PythonGroupAdditivity
import os
from warnings import warn
from collections import Mapping
from .. import yaml_io
import numpy as np
from .. Error import GroupMissingDataError
from . Group import Group, Descriptor
from . Scheme import GroupAdditivityScheme
from . DataDir import get_data_dir
cla... | StarcoderdataPython |
182854 | #!/usr/bin/env python
"""
train_SVM.py
VARPA, University of Coruna
<NAME>, <NAME>.
26 Oct 2017
"""
from sklearn import metrics
import numpy as np
class performance_measures:
def __init__(self, n):
self.n_classes = n
self.confusion_matrix = np.empty([])
self.Recall ... | StarcoderdataPython |
3345094 | <reponame>JulianEberius/Eclim.tmbundle
#!/usr/bin/env python
import os, sys
import eclim
import util
from util import caret_position, current_identifier
def call_eclim(project, file, length, offset, new_name):
eclim.update_java_src(project, file)
rename_cmd = "$ECLIM -command java_refactor_rename \
... | StarcoderdataPython |
63197 | # The MIT License (MIT)
#
# Copyright (c) 2011, 2013 OpenWorm.
# http://openworm.org
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the MIT License
# which accompanies this distribution, and is available at
# http://opensource.org/licenses/MIT
#
# Contributo... | StarcoderdataPython |
6535 | <filename>A2/semcor_chunk.py
from nltk.corpus import semcor
class semcor_chunk:
def __init__(self, chunk):
self.chunk = chunk
#returns the synset if applicable, otherwise returns None
def get_syn_set(self):
try:
synset = self.chunk.label().synset()
return synset
except AttributeError:
try:
syns... | StarcoderdataPython |
187397 | <reponame>k-nut/jedeschule-scraper
from __future__ import annotations # needed so that update_or_create can define School return type
import logging
import os
from geoalchemy2 import Geometry, WKTElement
from sqlalchemy import String, Column, JSON
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.declar... | StarcoderdataPython |
3370337 | """
数据访问层
data access layer
"""
import csv
from typing import List
from model import HouseModel
class HouseDao:
"""
房源数据访问对象
"""
__house_data = [] # type:List[HouseModel]
__FILE_NAME = "/home/tarena/PycharmProjects/untitled/house_information_manager_system/house.csv"
@classmethod... | StarcoderdataPython |
3302934 | <filename>fdk_client/platform/models/Bags.py
"""Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
from .BagItem import BagItem
class Bags(BaseSchema):
# Order swagger.json
item = fields.N... | StarcoderdataPython |
3206699 | from django.urls import path
from . import views
app_name = 'blog'
urlpatterns = [
path('', views.post_list_home, name='post_list'),
path('blog/over-explained/<str:slug>', views.explained, name="explained"),
path('blog/<str:category>/<str:series>/<str:slug>', views.post_detail, name='post_detail'),
pa... | StarcoderdataPython |
3395564 | <reponame>hristo-vrigazov/dnn.cool<gh_stars>10-100
import torch
from torch import nn
def dummy_tensor(inputs):
return nn.Parameter(data=torch.ones_like(inputs))
def dummy_dict(inputs):
res = nn.ParameterDict()
for key, value in inputs.items():
if key != 'gt' and not key.startswith('precondition... | StarcoderdataPython |
194912 |
import os
import time
import calendar
from glideinwms.lib import x509Support
from glideinwms.lib import condorExe
import logging
logger = logging.getLogger()
class Credential:
def __init__(self, proxy_id, proxy_fname, group_descript):
self.req_idle = 0
self.req_max_run = 0
self.adverti... | StarcoderdataPython |
1613439 | <filename>src/fidesops/schemas/connection_configuration/connection_config.py
from datetime import datetime
from typing import Optional, List
from pydantic import Extra, BaseModel
from fidesops.schemas.api import BulkResponse, BulkUpdateFailed
from fidesops.schemas.shared_schemas import FidesOpsKey
from fidesops.model... | StarcoderdataPython |
90511 | <reponame>BLSQ/iaso
from django.contrib.auth import update_session_auth_hash
from rest_framework import viewsets, permissions
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import Js... | StarcoderdataPython |
156384 | # Copyright 2017-2019 <NAME>, <NAME>, <NAME>
# Copyright 2019-2020 Intel Corporation
#
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
kAFL Slave Implementation.
Request fuzz input from Master and process it through various fuzzing stages/mutations.
Each Slave is associated with a single Qemu instance for executing ... | StarcoderdataPython |
174568 | ##
## PasswordChanger
## by AliAbdul
##
from Components.ActionMap import ActionMap
from Components.config import config, ConfigText, ConfigSubsection, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Components.Language import language
from Components.ScrollLabel import ScrollLabel
from os imp... | StarcoderdataPython |
118326 | from random import randint, choice
from discord.ext.commands import command, group
from names import get_full_name
from pony.orm import db_session, sql_debug
from .cog import Cog
from dicebag import Character, Race, Role
class DND(Cog):
@command()
async def characters(self):
"""Lists all of the creat... | StarcoderdataPython |
1776381 | <reponame>moacirsouza/nadas
print("""
097) Faça um programa que tenha uma função chamada escreva(), que receba um
texto qualquer como parâmetro e mostre uma mensagem com tamanho adaptável.
""")
def escreva(mensagem, caractereDeFormatacao='~'):
mensagemFormatada = f' {mensagem} '
comprimentoDaMensagem = len(men... | StarcoderdataPython |
3381078 | # interface to link up the methods info and the dynamic class builder
from provider import DriverMethod, get_providers_info, get_driver_methods
from dynamicclass import DynamicClass
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
# get list of the supported provider
def... | StarcoderdataPython |
4802833 | # -*- coding: utf-8 -*-
"""Imports for the credential manager."""
| StarcoderdataPython |
3327573 | # Copyright 2016-2020 The <NAME> at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you ... | StarcoderdataPython |
107185 | <filename>vision/datasets/VIRAT_DataLoader.py
import torch
import os
import sys
import numpy as np
import pickle
import torch.utils.data as data
import glob2
import logging
import cv2
logging.basicConfig(stream=sys.stdout, level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)... | StarcoderdataPython |
112239 | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import csv as csv
import argparse
from matplotlib.backends.backend_pdf import PdfPages
import cPickle as pickle
def outputFigure(dataDic,filename,xRange,yRange,title,xLabel,yLabel,loc,
maxCores,line):
fig = plt.figure()
fig.suptitl... | StarcoderdataPython |
1676496 | <filename>COVID19_prediction/COVID_model/model_util.py
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 9 17:18:28 2020
@author: XT
"""
from __future__ import print_function
import random
import joblib
import numpy as np
import pandas as pd
import requests
from sklearn import metrics
SR = 16000 # sample rate
import... | StarcoderdataPython |
1747679 | import rich_click as click
# Show the positional arguments
click.rich_click.SHOW_ARGUMENTS = True
# Uncomment this line to group the arguments together with the options
# click.rich_click.GROUP_ARGUMENTS_OPTIONS = True
@click.command()
@click.argument("input", type=click.Path(), required=True)
@click.option(
"--... | StarcoderdataPython |
3301761 | <reponame>ksetdekov/HSE_DS
n, m = map(int, input().split())
matrix = [list(map(int, input().split())) for _ in range(n)]
r_max, c_max = (0, 0)
highest = matrix[0][0]
for r in range(n):
for c in range(m):
if matrix[r][c] > highest:
r_max, c_max = (r, c)
highest = matrix[r][c]
prin... | StarcoderdataPython |
1621036 | <reponame>TonyBrother32/Django-shop<filename>geekshop/mainapp/urls.py
from django.urls import path
from . import views
app_name = 'mainapp'
urlpatterns = [
path('', views.products, name='products'),
path('<int:category_id>/', views.category, name='category'),
path('product/<int:product_id>/', views.product, ... | StarcoderdataPython |
1728016 | <gh_stars>10-100
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
import yaml
from contextlib import contextmanager
from PIL import Image
from io im... | StarcoderdataPython |
4821394 | import sys
from os import path
sys.dont_write_bytecode = True
mydir = path.abspath(path.dirname(sys.argv[0]) or ".")
sys.path[:] = [mydir] + [
p
for p in sys.path
if path.isabs(p)
and path.exists(p)
and not (path.samefile(p, ".") or path.samefile(p, mydir))
]
if __name__ == "__main__":
import ... | StarcoderdataPython |
1767795 | from django.contrib import admin
from blog.blog.models import Blog, Category
class BlogAdmin(admin.ModelAdmin):
exclude = ['posted']
prepopulated_fields = {'slug': ('title',)}
class CategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('title',)}
admin.site.register(Blog, BlogAdmin)
admin.s... | StarcoderdataPython |
29431 | <gh_stars>0
# plot rotation period vs orbital period
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import glob
import re
from gyro import gyro_age
import teff_bv as tbv
import scipy.stats as sps
from calc_completeness import calc_comp
# np.set_printoptions(threshold=np.nan, linewidth... | StarcoderdataPython |
54207 | <filename>setup.py
#!/usr/bin/env python3
from app import db
db.create_all()
| StarcoderdataPython |
3394881 | <reponame>schlunsen/mopidy-juliana<gh_stars>0
import logging
import pathlib
import pkg_resources
from mopidy import config, ext
__version__ = pkg_resources.get_distribution("Mopidy-Juliana").version
# TODO: If you need to log, use loggers named after the current Python module
logger = logging.getLogger(__name__)
... | StarcoderdataPython |
67799 | r"""Main loop for each swarm agent
___ _ _
/ __|_ __ ____ _ _ _ _ __ /_\ __ _ ___ _ _| |_
\__ \ V V / _` | '_| ' \ / _ \/ _` / -_) ' \ _|
|___/\_/\_/\__,_|_| |_|_|_| /_/ \_\__, \___|_||_\__|
|___/
"""
from .control.task_manager... | StarcoderdataPython |
1625265 | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | StarcoderdataPython |
1642306 | <filename>Program/PI/pub.py<gh_stars>0
import paho.mqtt.client as mqtt
import os
import serial
import time
import random
from time import strftime
from datetime import datetime
import requests
import json
import schedule
import numpy as np
import tensorflow as tf
import random
import time
model2 = tf.... | StarcoderdataPython |
3248005 | <gh_stars>0
"""Tests for runway.cfngin.actions.base."""
# pylint: disable=no-self-use,protected-access,unused-argument
# pyright: basic
import unittest
import botocore.exceptions
from botocore.stub import ANY, Stubber
from mock import MagicMock, PropertyMock, patch
from runway.cfngin.actions.base import BaseAction
fr... | StarcoderdataPython |
1766771 | from django.db import models
class ArticleBody(models.Model):
id = models.AutoField(primary_key = True)
body = models.TextField()
readonly_fields = ('id',)
def __str__(self):
return "{0}".format(self.id) | StarcoderdataPython |
1799929 | <reponame>Qcaria/Kinda-Space-Invaders
import pygame
#Imágenes
shipimg = pygame.image.load("C:/Users/Carlos/PycharmProjects/SpaceInvaders/sprites/ship.png")
shipimg2 = pygame.image.load("C:/Users/Carlos/PycharmProjects/SpaceInvaders/sprites/ship2.png")
bluealien = pygame.image.load("C:/Users/Carlos/PycharmProjects... | StarcoderdataPython |
3290588 | <reponame>cobanov/demc-homework
import sqlalchemy
import csv
import mariadb
import sys
import pandas as pd
from sqlalchemy import create_engine
import pymysql
import numpy
basics_path = './datasets/title.basics.tsv'
akas_path = './datasets/title.akas.tsv'
crew_path = './datasets/title.crew.tsv'
episode_path = './datas... | StarcoderdataPython |
3350585 | <reponame>sebras/berkeman-ExpertmakerAccelerator<filename>dscmdhelper.py
############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# ... | StarcoderdataPython |
3366421 | <filename>pychemia/visual/povray.py
import numpy as np
from pychemia.utils.periodic import atomic_number, covalent_radius, cpk_colors
class StructurePovray:
def __init__(self, structure):
self.structure = structure
self.distance = 10
def create_pov(self):
ret = """
#version 3.7;
#in... | StarcoderdataPython |
1700986 | <reponame>sjdhaneesh10/mezan<filename>mezan/member/serializer.py
from rest_framework import serializers
from .models import Family
class FamilySerializer(serializers.ModelSerializer):
id = serializers.IntegerField(read_only=True)
class Meta:
model = Family
#exclude = ['patient_image','patient_a... | StarcoderdataPython |
3219718 | import datetime
import time
class EarthquakeUSGS:
"""
@brief Class that holds earthquake data records.
Class that hold earthquake data, for use with USGIS retrieved quake data.
BRIDGES uses scripts to
continually monitor USGIS site (tweets) and retrieve the latest
quake data for use in stude... | StarcoderdataPython |
1689336 | <filename>datasets/datasets.py
# coding=utf-8
import sys
import csv
import numpy as np
import cv2
class Data():
def __init__(self):
pass
def get_unit(self):
pass
class Dataset():
def __init__(self, fn=None):
self.X = np.array([])
self.Y = np.array([])
def get_data(s... | StarcoderdataPython |
163057 | n1=int(input('Digite a idade da primeira pessoa:'))
n2=int(input('Digite a idade da segunda pessoa:'))
n3=int(input('Digite a idade da terceira pessoa:'))
#Maior ou igual a 100
#menor que 100
soma = n1+ n2+ n3
if soma > 100 or soma == 100:
print('Maior ou igual a 100')
else:
print('Menor que 100')
| StarcoderdataPython |
1716266 | <reponame>love3forever/hotroom-api
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017/12/7
# @Author : wangmengcn
# @Email : <EMAIL>
import socket
import re
from time import time, sleep
from datetime import datetime
from threading import Thread
from json import dumps
from . import r
class DouyuDM:
... | StarcoderdataPython |
38129 | <gh_stars>0
# Downloaded from Google Sheets, edited out the first line, and then...
# reader = csv.DictReader(open('from-sheets.csv', newline=''))
import csv
import toml
reader = csv.reader(open('from-sheets.csv', newline=''))
rows = [row for row in reader]
final_bold = {}
final_regular = {}
for (i, row) in enumerate(... | StarcoderdataPython |
1699322 | <gh_stars>0
from __future__ import print_function
from __future__ import division
from functools import partial
import tensorflow as tf
from layers import Attention, FeedForward, Encoder, Softmax
from tensorflow.contrib.seq2seq import sequence_loss
import nmt.all_constants as ac
import nmt.utils as ut
class Model(o... | StarcoderdataPython |
3352730 | <filename>tests/integration_tests/data_steward/cdr_cleaner/cleaning_rules/remove_ehr_data_without_consent_test.py
"""
Integration test for remove_ehr_data_without_consent module
Original Issues: DC-1644
The intent is to remove all ehr data for unconsented participants for EHR.
"""
# Python Imports
import os
from da... | StarcoderdataPython |
166597 | <gh_stars>0
from scowclient import ScowClient
import json
def listProcs():
sclient = ScowClient()
jsonObj = sclient.get('processDefinitions')
prettyPrintJson(jsonObj['processDefinitions'][0:4])
def prettyPrintJson(obj):
print json.dumps(obj, sort_keys=True, indent=4)
def main():
listProcs()
if... | StarcoderdataPython |
129315 | ##########################################################################################
# Machine Environment Config
DEBUG_MODE = False
USE_CUDA = not DEBUG_MODE
CUDA_DEVICE_NUM = 0
##########################################################################################
# Path Config
import os
import sys... | StarcoderdataPython |
3301182 | """Kea subnet-id sanity-check"""
# pylint: disable=invalid-name,line-too-long
import pytest
import misc
import srv_control
import srv_msg
@pytest.mark.v6
@pytest.mark.kea_only
@pytest.mark.subnet_id_sanity_check
@pytest.mark.abc
def test_v6_sanity_check_subnet_id_fix_able():
misc.test_setup()
srv_control.c... | StarcoderdataPython |
100400 | <reponame>nawafalqari/jsonwriter<filename>tests/tests.py
import __init__ as jsonWriter
db = jsonWriter.file('tests.json')
print(db.get('name')) # Nawaf
print(db.get('age')) # 10
db.set('age', 30, indent=None) # {"name": "Nawaf", "age": 30}
db.set('age', 30, indent=3)
'''
{
"name": "Nawaf",
"age":... | StarcoderdataPython |
1775347 | <gh_stars>0
import random
from plugins import AIchat
from plugins import dataManage
# 自动回复部分
screenWords = []
unknown_reply = ['诶?', '你说的话太深奥了', '我也不是很清楚呢', '不知道哦~', '你猜', '这是什么意思呢?', '嘤嘤嘤~我听不懂']
def reply(message, be_at, config, statistics, nickname, group_id, qq, mode):
global screenWords
screenWords = d... | StarcoderdataPython |
3244270 | <filename>venv/lib/python3.6/site-packages/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/ntp_global/ntp_global.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ impor... | StarcoderdataPython |
1636373 | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.urls import re_path
from django.contrib import admin
from django.contrib.sites.models import Site
from django.views import defaults as default_views
from django.contrib.staticfiles.storage i... | StarcoderdataPython |
3334544 | <gh_stars>1-10
# Copyright 2016-2021 <NAME>, 43ravens
# 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 a... | StarcoderdataPython |
27463 | # coding: utf-8
from django.db import models
from django.contrib.auth.models import User
from django.utils.text import slugify
class SharedFolder(models.Model):
name = models.CharField(max_length=50)
slug = models.SlugField(max_length=255, null=True, blank=True)
users = models.ManyToManyField(User, throu... | StarcoderdataPython |
174649 | from django.urls import path
from blog.views import (
BlogPostView,
CommentView,
CreatePostView,
DeletePostView,
DownVoteView,
HotPostsView,
IndexView,
UpdatePostView,
UpvoteView
)
urlpatterns = [
path('', IndexView.as_view(), name='index'),
path('hot_posts/', HotPostsView... | StarcoderdataPython |
97497 | from smtp_project import EmailExecutor
# ainda vou fazer com django
| StarcoderdataPython |
3380994 | import os
import pandas as pd
import numpy as np
import sys
import seaborn as sns
import matplotlib.pyplot as plt
sys.path.append('../')
from load_paths import load_box_paths
datapath, projectpath, wdir,exe_dir, git_dir = load_box_paths()
from processing_helpers import *
"""Define function methods"""
def load_data(col... | StarcoderdataPython |
1776472 | <reponame>hofbi/driver-awareness<gh_stars>0
"""Plot SA evaluation"""
import argparse
import os
from pathlib import Path
import matplotlib.pyplot as plt
import pandas as pd
import tikzplotlib
def plot_data(input_dir, output_dir, main_scenario, show_plot):
"""plot SA evaluation data"""
sa_df = pd.read_csv(inp... | StarcoderdataPython |
3225815 | import os
from os import listdir
from os.path import isfile, join
import glob
import argparse
from rasa.cli.test import run_nlu_test
from rasa.test import perform_nlu_cross_validation
from rasa.shared.data import get_nlu_directory
args = argparse.Namespace
# onlyfiles = [f for f in listdir("pipelines/") if isfile(joi... | StarcoderdataPython |
3367626 | import os
import pytest
import shutil
@pytest.fixture()
def sample_service(tmpdir):
shutil.copytree(os.path.dirname(__file__)+'/fixture/sample_service',
str(tmpdir / 'sample_service'))
target = str(tmpdir / 'sample_service')
os.chdir(target)
return target
| StarcoderdataPython |
80597 | <filename>backend/lola-backend/config.py
class Config(object):
DEBUG = True
DEVELOPMENT = True
class ProductionConfig(Config):
DEBUG = False
DEVELOPMENT = False
| StarcoderdataPython |
3355628 | from triton.dns.message.domains.domain import Domain
from .base import ResourceRecord
class CNAME(ResourceRecord):
class _Binary(ResourceRecord._Binary):
@property
def full(self):
return self.resource_record.cname.sub_encode(self.resource_record.cname.label)
id = 5
repr = ['c... | StarcoderdataPython |
59013 | <reponame>angelaaaateng/awesome-panel<gh_stars>0
"""This module provides the SOCIAL_LINKS list of social links"""
from package.awesome_panel.application.models import SocialLink
SOCIAL_LINKS = [SocialLink(name="Twitter")]
| StarcoderdataPython |
3381135 | <reponame>mbaragiola/drf-demo-app
from rest_framework.serializers import ModelSerializer
from apps.tables.models import Table
class TableSerializer(ModelSerializer):
class Meta:
model = Table
fields = ['table_name', 'fields', ]
# TODO: Validations could be added here.
| StarcoderdataPython |
1629954 | <reponame>MaximKuklin/3D_Object_Detection_Diploma
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mean_average_precision as map
import tqdm
import _init_paths
import os
import cv2
import torch
import numpy as np
import math
import matplotlib.pyplot ... | StarcoderdataPython |
39056 | <gh_stars>0
import zipfile
import requests
import os
import tempfile
# this script downloads additional pums data files
# legend
# https://www2.census.gov/programs-surveys/acs/tech_docs/pums/data_dict/PUMS_Data_Dictionary_2019.txt
def download_pums_data(year, record_type, state, **_kwargs):
assert record_type ... | StarcoderdataPython |
3201815 | <gh_stars>1-10
from typing import List
import requests
from python_plugin_example.hookimpl import hookimpl
DAD_JOKE_API_ENDPOINT = "https://icanhazdadjoke.com/"
class ICanHazDadJokePlugin:
@hookimpl
def retrieve_joke(self, amount: int) -> List[str]:
headers = {
"Accept": "application/js... | StarcoderdataPython |
121293 | <reponame>LucasBalbinoSS/Exercicios-Python
# print()
#
# print('NÚMEROS & MATEMÁTICA')
#
# print()
#
# n = str(input('Digite um número de 0 á 9999: '))
#
# print('Unidades:', n[3], '\nDezenas:', n[2], '\nCentenas:', n[1], '\nMilhar:', n[0])
n = int(input('\033[35mDigite um número de zero a 9999: '))
u = n // 1 % 10
d... | StarcoderdataPython |
1754808 | <filename>src/akappwid.py
from kivy.clock import Clock
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.lang import Builder
from appkit.src.akstatusbar import AKStatusBar
from appkit.src.akmenu import AKMenu
from appkit.src.akprojects import AKPro... | StarcoderdataPython |
3314960 | <gh_stars>1-10
# import nltk
# from nltk.corpus import stopwords
# from nltk.stem import WordNetLemmatizer
import csv
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import confusion_matrix
from sklearn.metrics imp... | StarcoderdataPython |
3209319 | <filename>nvk_ds/__init__.py
"""
The ``Prefect`` small datasources data package.
"""
| StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.