id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
3269316 | <filename>old/dea/io/qasync.py
""" Tools for working with async queues and tasks.
These are mostly failed experiments, too much complexity. Futures based
techniques compose better and are only slightly more expensive in terms of
overheads. I'm keeping these for now, but probably they will be deleted.
"""
import asynci... | StarcoderdataPython |
1636292 | from psy.irt import grm
| StarcoderdataPython |
3209489 | <reponame>maikelvl/workspace
from collections import defaultdict
import json
from os import environ, getcwd, path
import shutil
import subprocess
import ssh_utils
import utils
WORKSPACE = getcwd()
HOSTS_PATH = path.join(WORKSPACE, 'hosts')
HOSTS_TEMPLATE_PATH = path.join(WORKSPACE, '.hosts-template')
def host_path(... | StarcoderdataPython |
8038 | # Copyright (c) 2018 gevent community
#
# 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, copy, modify, merge, publish, di... | StarcoderdataPython |
1640429 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 <NAME> <<EMAIL>>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
from gensim.summarization.bm25 import ge... | StarcoderdataPython |
142743 | from configs import EXP_CONFIGS
import xml.etree.cElementTree as ET
from xml.etree.ElementTree import dump
from lxml import etree as ET
import os
E = ET.Element
def indent(elem, level=0):
i = "\n " + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + ""
... | StarcoderdataPython |
182112 | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.views import generic
from django.utils import timezone
from .models import Choice, Question
# Create your views here.
# All Django wants returned ... | StarcoderdataPython |
1754239 | import openai # pip install openai
from config import API_KEY_GPT3 as config
from train import CONTEXT as train
openai.api_key = config.API_KEY_GPT3
start_sequence = "\nSAM:"
restart_sequence = "\nHuman:"
def ask(question, chat_log=None):
prompt_text = f"{chat_log}{restart_sequence}: {question}{start_sequence}:"
... | StarcoderdataPython |
3290555 | <reponame>bbargstaedt/conflowgen<filename>conflowgen/application_models/container_flow_statistics_report.py<gh_stars>1-10
import logging
import statistics
from typing import List
from conflowgen.domain_models.data_types.mode_of_transport import ModeOfTransport
from conflowgen.domain_models.repositories.large_scheduled... | StarcoderdataPython |
1666180 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
CSS SCRIPT
"""
from collections import OrderedDict
import random
import math
class CssScript:
def __init__(self):
#
# HTML TEMPLATES PARTS
#
self.header = """
<!DOCTYPE html>
<html>
<head>
<title></title>
<style typ... | StarcoderdataPython |
3378322 | # Copyright (c) 2014 <NAME>.
# See LICENSE for details.
"""
Filesystem code used by all operating systems, including Windows as
Windows has its layer of POSIX compatibility.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from contextlib import contextman... | StarcoderdataPython |
25707 | <filename>ind3.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import math
if __name__ == '__main__':
a = input('ะะฒะตะดะธัะต ะฒัะตะผั: ')
t = 0
A = 1
V = int(int(a)/3)
if V == 0:
print('ะัะธะฑะบะฐ')
else:
while t < int(a):
t = t + 3
A... | StarcoderdataPython |
4829638 | from pprint import pprint
from configparser import ConfigParser
from azure.mgmt.resource import ResourceManagementClient
from azure.common.credentials import ServicePrincipalCredentials
# These are only imported for Type Hinting and Intellisense.
from azure.mgmt.resource.resources.models import ResourceGroup
from azu... | StarcoderdataPython |
28720 | <gh_stars>0
import datetime
import re
from app import db
from bson.objectid import ObjectId
from pymongo import InsertOne, UpdateOne
from pymongo.errors import BulkWriteError
from app.error.factoryInvalid import FactoryInvalid
class Model(object):
def __init__(self, id=None, name=None):
if name is None:
... | StarcoderdataPython |
58336 | <filename>odoo-13.0/addons/sale_quotation_builder/models/res_config_settings.py
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
@api.model
def ... | StarcoderdataPython |
3330734 | <gh_stars>10-100
"""
A Simple program to detect the human faces using Haarcascade Classifier
Date : 21 March 2019
Author : <NAME>
"""
import cv2
haar_cascade_face = cv2.CascadeClassifier('/home/shiyaztech/Documents/Applications/OpenCV/opencv/data/haarcascades/haarcascade_frontalface_default.xml')
class VideoCamera... | StarcoderdataPython |
197688 | from uuid import uuid4
from unittest import TestCase
from servicelayer.cache import get_redis, make_key
class CacheTest(TestCase):
def test_redis(self):
key = make_key('test', uuid4())
conn = get_redis()
assert not conn.exists(key)
conn.set(key, 'banana')
assert conn.get(... | StarcoderdataPython |
159158 | <filename>schemas/product_type.py
from marshmallow.fields import Nested
from marshmallow_mongoengine import ModelSchema
from models.product_type import ProductTypeModel
class ProductTypeSchema(ModelSchema):
# __nested__ = False
class Meta:
model = ProductTypeModel
exclude = ('translations',)... | StarcoderdataPython |
3351149 | from invoke import task
@task
def test(c):
c.run("pytest -v --doctest-modules --import-mode=append", pty=True)
@task
def lint(c):
c.run("python -m flake8 src/.", pty=True)
c.run("python -m flake8 tests/.", pty=True)
c.run("python -m black --check .", pty=True)
| StarcoderdataPython |
61637 | <gh_stars>0
from django.contrib import admin
from .models import Airport, Flight, Passenger
admin.site.register(Airport)
admin.site.register(Flight)
admin.site.register(Passenger)
| StarcoderdataPython |
1620879 | import numpy as np
#initalize parameters
#layer_dims = katmanlarฤฑn nรถron sayฤฑlarฤฑnฤฑ tutan liste (รถzellikler dahil)
def initilaize_parameters(layer_dims):
np.random.seed(1)
parameters = {}
L = len(layer_dims)
for l in range(1,L):
#np.sqrt(layer_dims[l-1]) sayesinde W parametresini daha kรผรงรผk sa... | StarcoderdataPython |
3331337 | class Solution:
"""
@param nums: A list of integers
@return: The majority number occurs more than 1/3
"""
def majorityNumber(self, nums):
# write your code here
count1 = 0
count2 = 0
candidate = [0,0]
for i in xrange(len(nums)):
if count1 == 0:
... | StarcoderdataPython |
4815270 | <reponame>texpomru13/espnet
#!/usr/bin/env python3
# Copyright 2021 Carnegie Mellon University (<NAME>)
import os
import os.path
import argparse
parser = argparse.ArgumentParser(description="Calculate classification accuracy.")
parser.add_argument("--wer_dir", type=str, help="folder containing hyp.trn and ref.trn")
... | StarcoderdataPython |
1686488 | <filename>readimc/data/_panorama.py
from dataclasses import dataclass
from typing import Dict, Optional, TYPE_CHECKING
if TYPE_CHECKING:
import readimc.data
@dataclass(frozen=True)
class Panorama:
"""Panorama metadata (only for panoramas with panorama image data)"""
slide: "readimc.data.Slide"
"""Pa... | StarcoderdataPython |
149603 | import random
import pandas as pd
shots = 90
ot_shots = 10
##########
# Team 1 #
##########
team1 = {
'2pt rate': .80,
'3pt rate': .20,
'2pt%': .50,
'3pt%': .33333,
'orbd': .225,
'foul3': .015,
'foul2': .057,
'ft%': .77
}
##########
# Team 2 #
##########
team2 = {
'2pt rate': .50... | StarcoderdataPython |
1791749 | from collections import defaultdict
def brainfuck_interpreter(code, input_):
cells = defaultdict(int)
cell = 0
pos = 0
output = ""
stack = []
jump_to = {}
for i, c in enumerate(code):
if c == '[':
stack.append(i)
if c == ']':
jump_to[... | StarcoderdataPython |
29303 | # importing libraries
import numpy as np
import pandas as pd
import random
import torch
def set_seeds(seed=1234):
"""[Set seeds for reproducibility.]
Keyword Arguments:
seed {int} -- [The seed value] (default: {1234})
"""
np.random.seed(seed)
random.seed(seed)
torch.manual_seed(seed)
... | StarcoderdataPython |
1798651 | <filename>dataCollection.py<gh_stars>10-100
from alpha_vantage.timeseries import TimeSeries
from datetime import datetime
import csv
import pandas as pd
import requests
import os
import glob
SYMBOL_URL = "http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange={}&render=download"
STOCK_EXCHANGES = ["n... | StarcoderdataPython |
3336611 | <reponame>LukasL97/shop-4-me
shop_owners = [
{
"id":"bg9hpzkhHcSIMm2C9IoniTSf",
"login":{"hashPassword":"<PASSWORD>","email":"<EMAIL>"},
"name":{"firstName":"Tyson","lastName":"Morar"}
},
{
"id":"usqsUKiOvpo0ao87oSIEKiqM",
"login":{"hashPassword":"<PASSWORD>","email":"<EMAIL>"},
"name":{"f... | StarcoderdataPython |
1675310 | """
Modified from django.utils.translation.trans_real
"""
from __future__ import unicode_literals
import re
from django.conf import settings
from django.urls import resolve
from django.urls import Resolver404
from django.urls.resolvers import RegexURLResolver
from django.utils.translation import get_language
from dja... | StarcoderdataPython |
4840315 | import json
import numpy as np
import matplotlib.pyplot as plt
from scipy.io.wavfile import write
# Synthesize the tone based on the input parameters
def tone_synthesizer(freq, duration, amplitude=1.0, sampling_freq=44100):
# Construct the time axis
time_axis = np.linspace(0, duration, duration * sampling_fr... | StarcoderdataPython |
32704 | from pydantic import BaseModel
class ReadyResponse(BaseModel):
status: str
| StarcoderdataPython |
3210356 | def get_attr_by_type(node, type):
for attr in node.attributes:
if attr.type == type:
return attr
return None
| StarcoderdataPython |
80074 | """Project Euler problem 3"""
def sqrt(number):
"""Returns the square root of the specified number as an int, rounded down"""
assert number >= 0
offset = 1
while offset ** 2 <= number:
offset *= 2
count = 0
while offset > 0:
if (count + offset) ** 2 <= number:
count... | StarcoderdataPython |
155327 | <reponame>John-ye666/Python-for-Finance-Second-Edition
"""
Name : c8_02_get_date_variable.py
Book : Python for Finance (2nd ed.)
Publisher: Packt Publishing Ltd.
Author : <NAME>
Date : 6/6/2017
email : <EMAIL>
<EMAIL>
"""
import pandas as pd
import scipy as sp
sp.random.see... | StarcoderdataPython |
1641425 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
from tqdm import tnrange, tqdm_notebook
import collections
import math
import numpy as np
from collections import defaultdict
import threading
import networkx as nx
import pandas as pd
import operator
def graph_dict():
'''
We first choose to use a dictionary f... | StarcoderdataPython |
4838967 | <reponame>dcompane/controlm_py<gh_stars>1-10
# coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.220
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
... | StarcoderdataPython |
4823672 | <gh_stars>0
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.views import generic
from . import views_help
from .forms import *
def index(request):
return render(request, 'tracers/index.html')
# TODO: add a warning before leaving page (here & for contact... | StarcoderdataPython |
1711003 | <filename>tests/test_event.py
from aiomessaging.event import Event
def test_simple():
e1 = Event('echo')
e2 = Event.from_dict({'type': 'echo'})
assert e1.type == e2.type
def test_to_dict():
e = Event('echo')
e.to_dict()
| StarcoderdataPython |
155947 | <reponame>codingJWilliams/Assignment_55_Ciphers
# <NAME> 2017
# This module is included as part of https://github.com/codingJWilliams/jw_utils
# Liscenced according to ../../LISCENCE
# Contact codingJWilliams on github with any queries
import jw_utils, os, json
class Bucket:
def __init__(self, uid, location=("." + ... | StarcoderdataPython |
1689787 | <filename>onnx2torch/node_converters/reduce.py
__all__ = [
'OnnxReduceSumDynamicAxes',
'OnnxReduceSumStaticAxes',
'OnnxReduceStaticAxes',
]
from functools import partial
from typing import Any
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import torc... | StarcoderdataPython |
1733104 | <gh_stars>0
from unittest import TestCase
from nose.tools import eq_
from . import fakeinstance
from ..utils import compose_key, decompose_key, translate
_foo_cache = {}
class FakeModelManager(object):
def get(self, **kwargs):
return _foo_cache[kwargs['id']]
class FakeModel(object):
def __init__... | StarcoderdataPython |
3215595 | """
Periodic Hexagonal
==================
"""
import numpy as np
from ...reactions import GenericReactionFactory
from ..topology_graph import Edge, NullOptimizer
from .cof import Cof
from .vertices import LinearVertex, NonLinearVertex
class PeriodicHexagonal(Cof):
"""
Represents a periodic hexagonal COF t... | StarcoderdataPython |
32191 | <filename>apc/apc/apc_config.py
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 13 11:30:05 2019
@author: <NAME>
"""
# config.py
import os
from pathlib import Path
from inspect import currentframe, getframeinfo
fname = getframeinfo(currentframe()).filename # current file name
current_dir = Path(fname).resolve().... | StarcoderdataPython |
169432 | <gh_stars>1-10
import pytest
@pytest.fixture(scope="module")
def states():
return ["ny", "tn", "tx", "pa"]
| StarcoderdataPython |
75531 | #coding=utf-8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... | StarcoderdataPython |
1602905 | """
Flask-S3-Custom
-------------
Link S3 to your file. Based on flask-s3 by e-dard
"""
from setuptools import setup
setup(
name='Flask-S3-Custom',
version='0.0.1',
url='http://github.com/yuerany/flask-s3-custom',
license='WTFPL',
author='<NAME>',
author_email='<EMAIL>',
description='Link... | StarcoderdataPython |
147752 | from typing import Generic, TypeVar
K = TypeVar('K')
V = TypeVar('V')
class MultiMap(Generic[K, V], dict[K, list[V]]):
def add(self, key: K, value: V):
if (values := self.get(key)) is not None:
values.append(value)
else:
self[key] = [value]
| StarcoderdataPython |
3374829 | #!/usr/bin/env python
import vtk
def main():
colors = vtk.vtkNamedColors()
# Set the background color.
colors.SetColor("BkgColor", [51, 77, 102, 255])
titles = list()
textMappers = list()
textActors = list()
uGrids = list()
mappers = list()
actors = list()
renderers = list(... | StarcoderdataPython |
3349093 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 |
3241012 | <reponame>rafaelclemes81/Python
"""043 - DESENVOLVA UMA LรGICA QUE LEIA O PESO E A ALTURA DE UMA PESSOA, CALCULO SEU IMC E MOSTRE SEU STATUS,
DE ACORDO COM A TABELA ABAIXO:
- ABAIXO DE 18,5: ABAIXO DO PESO
- ENTRE 18,5 E 25: PESO IDEAL
- ENTRE 25 E 30: SOBREPESO
- ENTRE 30 E 40: OBESIDADE MORBIDA"""
print('-'... | StarcoderdataPython |
3319453 | import tensorflow as tf
import numpy as np
hparams = tf.contrib.training.HParams(
#####################################
# Audio config
#####################################
sample_rate=22050,
silence_threshold=2,
num_mels=80,
fmin=125,
fmax=7600,
fft_size=1024,
win_length=1024,
... | StarcoderdataPython |
3287513 | # -*- coding: utf-8 -*-
"""URLs to manipulate workflows, attributes, columns and shared."""
from django.urls import path, re_path
from rest_framework.urlpatterns import format_suffix_patterns
from ontask.workflow import api, views
app_name = 'workflow'
urlpatterns = [
path('create/', views.WorkflowCreateView.a... | StarcoderdataPython |
1749141 | #!/usr/bin/env python
from swagger_ui_bundle import swagger_ui_path
from flask import Flask, Blueprint, send_from_directory, render_template
swagger_bp = Blueprint(
'swagger_ui',
__name__,
static_url_path='',
static_folder=swagger_ui_path,
template_folder=swagger_ui_path
)
SWAGGER_UI_CONFIG = {... | StarcoderdataPython |
4809729 | # ----------------------------------------------------------------------------
# color_wheel.py
#
# The MIT License (MIT)
# Copyright (c) 2020 <NAME>
# 2020-12-20, v1
# ----------------------------------------------------------------------------
def getColorFromWheel(iWheel):
""" Get an RGB color from a wheel-like co... | StarcoderdataPython |
3398569 | """The tests for Netatmo webhook events."""
from homeassistant.components.netatmo.const import DATA_DEVICE_IDS, DATA_PERSONS
from homeassistant.components.netatmo.webhook import async_handle_webhook
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.util.aiohttp import MockRequest
... | StarcoderdataPython |
4831015 | <reponame>theslytherin/Invisibility-cloak---Harry-Potter<gh_stars>0
from .hough_circle import HoughCircleDetector | StarcoderdataPython |
3221235 | <reponame>JWKennington/pynstein<gh_stars>0
"""Unittests for pystein.symbolic.constants module"""
# pylint: disable=protected-access
from pystein import symbols
class TestSymbols:
"""Test Symbols"""
def test_numeric_symbol(self):
"""Test numeric symbol"""
a = symbols.numeric_symbol('a')
... | StarcoderdataPython |
54614 | <reponame>caedonhsieh/ps-munna
from setuptools import setup
with open('README.md') as file:
long_description = file.read()
# TODO - replace with details of your project
setup(
name='munna',
description='Pokemon Showdown MatchUp Neural Network Analysis',
version='0.0.1',
author='<NAME>',
auth... | StarcoderdataPython |
1772241 | <filename>dev/05_18_2018/VFD_Controller.py
# Universal Power Supply Controller
# USAID Middle East Water Security Initiative
#
# Developed by: <NAME>
# Primary Investigator: <NAME>
#
# Version History (mm_dd_yyyy)
# 1.00 03_24_2018_NW
#
######################################################
# Import Libraries
import Pa... | StarcoderdataPython |
1740178 | <filename>gammafit/tests/test_utils.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.tests.helper import pytest
from astropy.utils.data import get_pkg_data_filename
import astropy.units as u
from ..utils import validate_data_table, sed_conversion, generate_energy_edges... | StarcoderdataPython |
4842107 | import pytest
from app_data.selectors.amazon import NEXT_BUTTON
from helpers import dom
from helpers.amazon import do_search, verify_search_result_summary
URL = {
'link': 'https://www.amazon.com/',
'title': 'Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more'
}
@pytest.mark.... | StarcoderdataPython |
3356029 | # <NAME> @ipvs
# 180921
from __future__ import print_function
import h5py
import os
import numpy as np
# Create a dataset with the first dim is expandable
def create_appendable_dset(fname,dset_name,data):
dshape = data.shape
maxshape = [None]*len(dshape)
for i in range(1,len(dshape)):
maxshape[i]... | StarcoderdataPython |
150035 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: deeplab_saved_model copy.py
# Created Date: 2019-09-23
# Author: jingxiaofei
# Contact: <<EMAIL>>
#
# Last Modified: Thursday September 26th 2019 10:20:55 pm
#
# Copyright (c) 2019 KKWorld
# It is never too late to be what you might have been.
# -----
# HISTOR... | StarcoderdataPython |
48199 | <gh_stars>0
###########################
#
# #171 Finding numbers for which the sum of the squares of the digits is a square - Project Euler
# https://projecteuler.net/problem=171
#
# Code by <NAME>
#
###########################
| StarcoderdataPython |
1683062 | <reponame>maquinuz/flask-shop
from flask import render_template, redirect, url_for, request, flash
from flaskshop.public.models import MenuItem, Page
from flaskshop.dashboard.models import DashboardMenu, Setting
from flaskshop.product.models import Category, Collection
from flaskshop.checkout.models import ShippingMet... | StarcoderdataPython |
3314827 | x = int(input("Give a number: "))
if x < 10:
if x < 5:
print("x is less than 5")
else:
print("x is greater than 5 and less than 10")
elif x >= 10 and x < 20: #Can be written as x <= 10 < 20
if x < 15:
print("x is less than 15 and greater or equal than 10")
elif x == 15:
... | StarcoderdataPython |
62833 | <gh_stars>10-100
#!/usr/bin/env python
from distutils.core import setup
setup(name='Pyquake',
version='1.0',
entry_points={
'console_scripts': [
'demo_viewer = pyquake.render:demo_viewer_main',
'ray_tracer = pyquake.ray:raytracer_main',
'pyqclient... | StarcoderdataPython |
3285211 | <gh_stars>0
"""
functions to run FFT sampling
"""
from __future__ import print_function
import sys
import os
import netCDF4
import numpy as np
sys.path.append("../bpmfwfft")
from bpmfwfft.fft_sampling import Sampling
BSITE_FILE = None
def sampling(rec_prmtop, lj_sigma_scal_fact,
rec_inpcrd, grid_... | StarcoderdataPython |
1634864 | <filename>K-Cap_2021/2A_KB_embeddings/inspect_embeddings.py
"""How well do our embeddings capture our annotation set vocabulary?
"""
import json
from functools import partial
import numpy as np
import pandas as pd
from gensim.models import Word2Vec
def main():
# embeddings subset tokens
with open("embeddin... | StarcoderdataPython |
188506 | import logging
from typing import List, Dict, Set, Union, cast, Type
import pandas as pd
from genomics_data_index.storage.SampleSet import SampleSet
from genomics_data_index.storage.model.NucleotideMutationTranslater import NucleotideMutationTranslater
from genomics_data_index.storage.model.QueryFeature import QueryF... | StarcoderdataPython |
1790923 | <filename>bindings/python/setup.py
try:
import distribute_setup
distribute_setup.use_setuptools()
except:
pass
from setuptools import setup, find_packages
import os
import re
with open(os.path.join(os.path.dirname(__file__), 'opentick',
'__init__.py')) as f:
version = re.search("__versi... | StarcoderdataPython |
3301305 | <reponame>scp2/pythonpep8typing
class filanormal:
codigo
fila = []
clintesatendidos = []
senhaatual
def gerasenhaatual(self)->None:
self.senhaatual = f'NM{self.codigo}'
def resetafila(self)->None:
if self.codigo >= 100:
self.codigo = 0
else:
se... | StarcoderdataPython |
131301 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..qt1 import FitQt1
def test_FitQt1_inputs():
input_map = dict(
acceptance=dict(argstr="-acceptance %f",),
args=dict(argstr="%s",),
b1map=dict(argstr="-b1map %s", extensions=None,),
comp_file=dict(
argstr="-comp... | StarcoderdataPython |
1617889 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Evento(models.Model):
titulo = models.CharField(max_length=100, verbose_name='Tรญtulo')
descricao = models.TextField(blank=True,null=True, verbose_name='Descriรงรฃo')
data_evento = models.DateTimeField(ver... | StarcoderdataPython |
3223498 | <gh_stars>0
# -*- coding: utf-8 -*-
import json
from typing import Type
from zvt.contract.api import del_data, get_db_session
from zvt.contract.schema import Mixin
class StatefulService(object):
state_schema: Type[Mixin] = None
name = None
def __init__(self) -> None:
assert self.state_schema is ... | StarcoderdataPython |
1709438 |
import re
import os
import shutil
import tempfile
try:
from tempfile import TemporaryDirectory
except ImportError:
class TemporaryDirectory(object):
def __init__(self):
self.name = tempfile.mkdtemp()
def __del__(self):
self.cleanup()
def __enter__(self):
... | StarcoderdataPython |
3347582 | <gh_stars>1-10
# Copyright 2020-2021 The Kubeflow Authors
#
# 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 |
198091 | <reponame>kira78/meson
# Copyright 2012-2017 The Meson development team
# 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 ... | StarcoderdataPython |
6085 | #
# PySNMP MIB module MWORKS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MWORKS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:16:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | StarcoderdataPython |
3281270 | <gh_stars>0
"""
Create a JAR that can be used to deploy a topology to Storm.
"""
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import sys
from fabric.api import hide, local, settings
from ..util import prepare_topology
from .common import add_simple_jar
def jar_f... | StarcoderdataPython |
52929 | # coding=utf8
from base import ApiBase
from tornado.gen import coroutine, Return
from service.user import ServiceUser
class ApiUserBase(ApiBase):
def __init__(self, *args, **kwargs):
super(ApiUserBase, self).__init__(*args, **kwargs)
self.srv_user = ServiceUser()
class ApiUserLogin(ApiUserBase):... | StarcoderdataPython |
1688072 | from hypothesis import given
from tests.port_tests.hints import PortedDiagram
from . import strategies
@given(strategies.diagrams)
def test_basic(diagram: PortedDiagram) -> None:
result = diagram.clear()
assert result is None
| StarcoderdataPython |
3274904 | <gh_stars>0
from . import __version__ as app_version
app_name = "masar_cost"
app_title = "Moving Average Cost"
app_publisher = "KCSC"
app_description = "Modifications on Moving Average Cost"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "<EMAIL>"
app_license = "MIT"
# Includes in <head>
#... | StarcoderdataPython |
3254638 | <gh_stars>1-10
# Copyright 2017 <NAME>, <NAME>, <NAME>, <NAME>
# 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 |
1647705 | <reponame>ferjorosa/test-glfm<filename>demos/python/demo_completion_MNIST.py
# coding: utf-8
# # Introduction to the General Latent Feature Model (GLFM)
# # DEMO_MATRIX_COMPLETION
# In[1]:
## import necessary packages
import numpy as np # library to work with numpy arrays and math operations
from random import samp... | StarcoderdataPython |
167634 | <filename>model/simplebase_model.py
import tensorflow as tf # noqa
import numpy as np # noqa
from ..utils import nn # noqa
import transforms as trans
import conditionals as conds # noqa
import likelihoods as likes
from ..model import model as mod
class SimpleBaseModel(mod.Model):
# TODO: docstring.
def _... | StarcoderdataPython |
3282973 | <reponame>nishadg246/stripstream-ivan-nishad<filename>stripstream/fts/derived.py
from stripstream.pddl.logic.predicates import Predicate
from stripstream.pddl.objects import Constant
from stripstream.pddl.operators import STRIPSAxiom
from stripstream.fts.variable import FreeParameter, VarMember, Par
def create_axiom(c... | StarcoderdataPython |
3390773 | <gh_stars>0
# -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.visitors.wrong_name import (
BAD_MODULE_METADATA_VARIABLES,
WrongModuleMetadataViolation,
WrongModuleMetadataVisitor,
)
module_test = """
{0} = 'Nikita'
"""
nested_test = """
class ORM:
{0} = None
"""
@pytest.mark.para... | StarcoderdataPython |
3232216 | <gh_stars>0
# https://github.com/TDD-Katas/frequent-words
# Given a list of words, print the list of top N most frequently occurring words in the list
# together with their frequency of occurrence.
# The output should be sorted in descending order by frequency of occurrence.
# If two words occur with the same frequenc... | StarcoderdataPython |
1707508 | <gh_stars>10-100
class Solution:
def subarraysDivByK(self, A: List[int], K: int) -> int:
res = sm = 0
sums = collections.defaultdict(int)
sums[0] = 1
for a in A:
sm = (sm + a) % K
sums[sm] += 1
res += sums[sm] - 1
return res | StarcoderdataPython |
3377120 | from .nodes import Function, ActionNode, ConditionNode, SequenceNode, FallbackNode, DecoratorNode, add_child
import uuid
#############################################################################################
#############################################################################################
##########... | StarcoderdataPython |
52416 | <reponame>FranckLejzerowicz/routine_qiime2_analyses
# ----------------------------------------------------------------------------
# Copyright (c) 2020, <NAME>.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------... | StarcoderdataPython |
3333856 | #!/usr/bin/env python
"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
Word trend analyzer for the "Toxic Docs" repository from Columbia University
and the Center for Public Integrity. Data set consists of PDF files of
emails, memos, advertisements, news articles, scientific articles cited in
legal cases involving all... | StarcoderdataPython |
39623 |
import sys
import os
if sys.platform == 'linux':
sys.path.append('/n/groups/patel/samuel/Aging')
elif sys.platform == 'darwin':
sys.path.append('/Users/samuel/Desktop/Aging')
from aging.model.environment_predictor import EnvironmentPredictor
name = sys.argv[1]
n_iter = int(sys.argv[2])
target_dataset = sy... | StarcoderdataPython |
1603755 | # Copyright 2013 Google Inc. All Rights Reserved.
"""Lists instances in a given project.
Lists instances in a given project in the alphabetical order of the
instance name.
"""
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.cor... | StarcoderdataPython |
41365 | from django.contrib.auth import views as auth_views
from django.urls import path
from django.urls.base import reverse_lazy
from django.views.decorators.csrf import csrf_exempt
from . import views, webhooks
from .forms.authorization import CosmosPasswordChangeForm, CosmosPasswordResetForm, CosmosSetPasswordForm
app_na... | StarcoderdataPython |
56800 | <reponame>saravankumarpa/sbc-pay
# Copyright ยฉ 2019 Province of British Columbia
#
# 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 ... | StarcoderdataPython |
1648204 | <reponame>amackillop/DockerWorkshop<filename>simple_app/src/app.py<gh_stars>0
from flask import Flask, request
import requests
import tensorflow as tf
import numpy as np
import imghdr
from io import BytesIO
app = Flask(__name__)
MODEL = tf.keras.applications.MobileNetV2(
input_shape=None,
alpha=1.0,
incl... | StarcoderdataPython |
1698552 | <gh_stars>0
from django.conf.urls import url
from .views import SearchView
urlpatterns = [
url('^$', SearchView.as_view(), name='search'),
]
| StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.