id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
172538 | <filename>Python/Tests/TestData/RemoveImport/EmptyFuncDef2.py
def f():
import fob
import oar | StarcoderdataPython |
1855207 | def bubble_sort(lista):
n = len(lista)
for i in range(n):
for j in range(0, n - i - 1):
if lista[j] > lista[j + 1]:
temp = lista[j]
lista[j] = lista[j + 1]
lista[j + 1] = temp
return lista
bubble_sort([12, 31, 5, 3, 0, 43, 99, 78, 32, 9,... | StarcoderdataPython |
9796998 | <filename>messaging/migrations/0005_slacklog_type.py
# Generated by Django 3.1.13 on 2021-11-06 12:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("messaging", "0004_slacklog_channel"),
]
operations = [
migrations.AlterField(
... | StarcoderdataPython |
74510 | <filename>website/migrations/0006_auto_20181006_2147.py
# Generated by Django 2.1.2 on 2018-10-06 20:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('website', '0005_committeerolemember_role_short_name'),
]
operations = [
migrations.AlterMode... | StarcoderdataPython |
8171847 | #
# Copyright 2019-2020 <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 applicable law or agreed to in writing... | StarcoderdataPython |
3404832 | <filename>evol/utils.py
from inspect import signature
from typing import List, Callable, Union, Sequence, Any, Generator
from evol import Individual
def offspring_generator(parents: List[Individual],
parent_picker: Callable[..., Union[Individual, Sequence]],
combiner: ... | StarcoderdataPython |
4983164 | <reponame>libaibuaidufu/flask-blog
#!/usr/bin/env python
#coding:utf-8
import os,sys
from app import create_app,db
from app.models import User,Role,Liuyan,Post,Follow,Fenlei
from flask_script import Manager,Shell
from flask_migrate import Migrate,MigrateCommand
reload(sys)
sys.setdefaultencoding('utf-8')
app = creat... | StarcoderdataPython |
11318780 | <filename>classification_api/PlainTextParser.py
import codecs
from django.conf import settings
from rest_framework.exceptions import ParseError
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
media_type = "text/plain"
def parse(self, stream, media_type=None, parser_context=No... | StarcoderdataPython |
9674419 | <reponame>tsroten/yweather<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 <NAME>
# 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 li... | StarcoderdataPython |
168322 | import networkx
import numpy
import chainer
from chainer_chemistry.dataset.graph_dataset.base_graph_dataset import PaddingGraphDataset, SparseGraphDataset # NOQA
from chainer_chemistry.dataset.graph_dataset.base_graph_data import PaddingGraphData, SparseGraphData # NOQA
from chainer_chemistry.dataset.graph_dataset.f... | StarcoderdataPython |
100053 | import platform
from pathlib import Path
import numpy as np
import torch
from spconv.pytorch import ops
from spconv.pytorch.conv import (SparseConv2d, SparseConv3d, SparseConvTranspose2d,
SparseConvTranspose3d, SparseInverseConv2d,
SparseInverseConv3d, SubMConv2d, Sub... | StarcoderdataPython |
3316586 | import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.ext.mutable import MutableDict
from lms.db import BASE
class Assignment(BASE):
"""
An assignment configuration.
When an LMS doesn't support LTI content-item selection/deep linking (so it
doesn't support storing ... | StarcoderdataPython |
3565474 | <gh_stars>0
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_paymentsos import signals
from django_paymentsos.enumerators import ResultStatus, EventType
from django_paymentsos.fields import JSONField
from django_paymentsos.utils import get_sig... | StarcoderdataPython |
1803987 | #!/usr/bin/env python
# encoding: utf-8
import sys
if sys.version_info[0] == 2 and sys.version_info[1] == 7: # do not run with tox in non-2.7 versions (fails because not building the C files)
import unittest
import os
from Naked.toolshed.c.shell import execute, execute_rb, execute_js, run, run_rb, run_js,... | StarcoderdataPython |
9600360 | <filename>src/experiment/process_results/average_inverse_load.py<gh_stars>1-10
import experiment.process_results.result_handling_utils as result_handling
def get_num_actions(e_runs):
"""
Takes all the data and extracts the number of actions. This is useful for defining the legend.
"""
agent_name = lis... | StarcoderdataPython |
11312902 | ## Exercício 62 do livro Python 3 - Conceitos e Aplicações - Uma Abordagem Didática
""" Faça uma pesquisa sobre o Algoritmo de Ordenação Quicksort. Implemente uma função recursiva que use algoritmo para
organizar a lista L de forma crescente. Escreva um programa para testar a função. """
import random
import time
de... | StarcoderdataPython |
1732890 | # -*- coding: utf-8 -*-
from django import template
from django.template.defaultfilters import stringfilter, escape
from django.utils.safestring import mark_safe
from django.conf import settings
import re
register = template.Library()
@register.tag(name='get_googlecharts_url')
def do_get_googlecharts_url(parser, toke... | StarcoderdataPython |
5082529 | <gh_stars>0
from .audio import *
from .graphics import *
from .input import *
from .other import *
from .graphics import _SizedInternalFormat, _CompressedInternalFormat, _TextureFormat | StarcoderdataPython |
9637333 | import datajoint as dj
#### LOAD DATABASE #########################################
from .dj_conn import *
imhotte = dj.schema(horst_imaging_db)
@imhotte
class AnatomicalMaskParams(dj.Lookup):
definition = """
# LUT for anatomical masks drawn in Napari to identify subregions in FOV
timestamp_mask_looku... | StarcoderdataPython |
1641699 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | StarcoderdataPython |
3517626 | import click
import os
import subprocess
from collections import namedtuple
from jinja2 import Environment, FileSystemLoader
Urls = namedtuple('Urls', ['fqdn', 'git'])
NGINX_CONFIG_PATH = '/etc/nginx/apps.d'
GIT_PATH = '/opt/serve'
APP_PATH = '/home/serve/apps'
AUTHORIZED_KEYS = '/home/serve/.ssh/authorized_keys'
try... | StarcoderdataPython |
5134931 | #crie um programa que tenha uma lista chamada numeros e duas funcoes chamadas sorteia() e somaPar(). A
# primeira funcao vai sortear 5 numeros e vai coloca-los dentro de uma lista e a segunda funcao vai mostrar
#a soma entre todos os valores PARES sorteados pela funcao anterior.
from random import randint
from time imp... | StarcoderdataPython |
8092595 | <reponame>capybara-translation/ooxmlreplacer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import uuid
import zipfile
from lxml import etree
W_NS = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'
W = '{%s}' % W_NS
A_NS = 'http://schemas.openxmlformats.org/drawingml/2006/main'
A = '{%s}'... | StarcoderdataPython |
9683439 | <gh_stars>0
import sys
s = input("Write sentences: ")
symb = input("Write search symbol: ")[0]
i = 0
count = 0
sl = []
while i < len(s):
if symb == s[i]:
print(f"Symbol '{symb}' found on {i} position")
count += 1
i += 1
if count == 0:
print(f"Symbol '{symb}' not found")
| StarcoderdataPython |
392427 | from django.db import models
from .fields import LiveField
from .managers import LiveManager
class LiveModel(models.Model):
"""Model support for soft-deleting using LiveField
LiveModel overrides Model.delete() to provide soft-deletion via
a LiveField. `.delete()` updates `Model.live` to `True`. Normal
... | StarcoderdataPython |
11236487 | <reponame>ESIPFed/SensorDat<gh_stars>1-10
import copy
import json
import numpy as np
import pandas as pd
import re
import influxdb_driver
def constant(value, series):
if isinstance(series, pd.Series):
return pd.Series(value, index=series.index)
elif isinstance(series, pd.Index):
return pd.Seri... | StarcoderdataPython |
6604828 | # -*- coding: UTF-8 -*-
import os
from gettext import gettext as _
from sugar.activity import activity
MODE_PHOTO = 0
MODE_VIDEO = 1
MODE_AUDIO = 2
TYPE_PHOTO = MODE_PHOTO
TYPE_VIDEO = MODE_VIDEO
TYPE_AUDIO = MODE_AUDIO
STATE_INVISIBLE = 0
STATE_READY = 1
STATE_RECORDING = 2
STATE_PROCESSING = 3
STATE_DOWNLOADING = ... | StarcoderdataPython |
6504523 | #! /usr/bin/python3.6
import logging
import json
import re
from collections import defaultdict
from autobridge.Opt.Slot import Slot
from autobridge.Device.DeviceManager import DeviceU250
U250_inst = DeviceU250()
class CreateResultJson:
def __init__(
self,
floorplan,
wrapper_creater,
globa... | StarcoderdataPython |
8183792 | <gh_stars>10-100
import time
import uuid
from test_helper import get_fail_workflow_execution
import floto
import floto.api
import floto.decider
from floto.specs import DeciderSpec
from floto.specs.task import ActivityTask, ChildWorkflow
from floto.specs.retry_strategy import InstantRetry
def decider_spec_child_work... | StarcoderdataPython |
8138312 | # python3
# pylint: disable=g-bad-file-header
# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | StarcoderdataPython |
8150456 | <filename>inbm/diagnostic-agent/tests/unit/test_docker_bench_security_runner.py<gh_stars>1-10
from unittest import TestCase
from diagnostic.docker_bench_security_runner import DockerBenchRunner
from mock import patch
docker_bench_pass_output = "[INFO] 6 - Docker Security Operations \n" \
"[... | StarcoderdataPython |
288429 | # Strings - this is how you type a comment in python
'Hello world using single quotes'
"Hello world using double quotes"
"""Hello world using
triple quotes, also known as
multi-line strings"""
# To print an object to the screen, use the print function
print('Hello world') # This will print Hello World in the terminal... | StarcoderdataPython |
3476686 | from unittest import TestCase
from lie2me.fields import Boolean
from .common_tests import CommonTests
class BooleanTestCase(TestCase, CommonTests):
def setUp(self):
self.Field = Boolean
self.valid_default = 'yes'
def test_true_values(self):
field = Boolean()
samples = [True,... | StarcoderdataPython |
320380 | from retic import Void
from iri2uri import Iri2Uri
from Timer import Timer
import os
#bg
def main()->Void:
iri2uri = Iri2Uri().iri2uri
### 1. test correctness on invariant iri
invariant = [
"ftp://ftp.is.co.za/rfc/rfc1808.txt",
"http://www.ietf.org/rfc/rfc2396.txt",
"ldap://[2001:d... | StarcoderdataPython |
1681239 | from unittest import TestCase
from algorithms.minimax import Minimax
from utils.node import Node
from tests._tree_example import eval_side_effect
from tests._tree_example import terminal_side_effect
from tests._tree_example import actions_side_effect
from tests._tree_example import result_side_effect
class TestMinima... | StarcoderdataPython |
9751341 | <filename>python/testData/completion/fStringLikeCompletionNotAvailableInStrFormatCalls.py
my_expr = 42
s = 'foo{my_e<caret>'.format(my_expr='spam') | StarcoderdataPython |
1963196 | """
This module contains the discord cog for managing channels
"""
import asyncio
from typing import Optional
from uuid import uuid4, UUID
import discord
from discord.ext import commands
from models import Guild, ChannelCategory, VoiceChannel, ChannelOwner
class ChannelCog(commands.Cog, name='Channel Commands'):
... | StarcoderdataPython |
1678046 |
from rest_framework import pagination, viewsets
from rest_framework_filters import backends
from .filters import DFUserFilter, NoteFilter, UserFilter
from .models import Note, User
from .serializers import NoteSerializer, UserSerializer
class DFUserViewSet(viewsets.ModelViewSet):
# used to test compatibility w... | StarcoderdataPython |
6688486 | from django.contrib import admin
from django.urls import path
from .views import *
app_name = 'products'
urlpatterns = [
path('',chart_select_view, name='main-products-view'),
] | StarcoderdataPython |
1838560 | <reponame>gratimax/jarvis
from multiprocessing import Pool
import os
import os.path
import pickle
import re
from pyquery import PyQuery as pq
import requests
from jarvis.model import *
p = re.compile('\s.\.')
COURSES_SCHEDULE = 'https://www.deanza.edu/schedule/classes/index.html'
COURSES_SEARCH = 'https://www.deanza... | StarcoderdataPython |
6563934 | import torch
from torch import nn
class MatMul(nn.Module):
def forward(self, A, V):
return torch.matmul(A, V)
| StarcoderdataPython |
6523005 | <reponame>thekitchenscientist/pydotART<filename>paintmixing.py
# -*- coding: utf-8 -*-
"""
Created on Thurs Aug 05 13:07:36 2021
@author: Stephen
https://github.com/thekitchenscientist/pydotART
Sample programs for the 41935 Set
https://rebrickable.com/sets/41935-1/lots-of-dots/#parts
"""
import pydotART as da
import... | StarcoderdataPython |
299035 | <gh_stars>0
import torch
import torchtext
import torchtext.data as data
import locations
# TODO subclass an abstract Dataset class.
# Perhaps also a TextDataset class.
class WikiText2(object):
# Some sensible defaults.
name = "WikiText-2"
default_model = "wlm_lstm_medium"
location = None
# Thes... | StarcoderdataPython |
3200377 | import wandb
from src.Data import Data
from src.configurations import Configuration, WandbLogs
from src.models.BestPreTrainedModelForAStation import BestPreTrainedModelForAStation
from src.models.PerStationModel import PerStationModel
from src.run_utils import LogKeys, train_predict_evaluate_log_for_model_and_data
d... | StarcoderdataPython |
4999227 | <gh_stars>1-10
import abc
import operator
from typing import Optional, Dict
import numpy as np
from ..state import StateKey
class Evaluator(abc.ABC):
"""Base class that defines the general 'evaluator' interface."""
@abc.abstractmethod
def is_active(self) -> bool:
"""Returns whether or not an evaluator con... | StarcoderdataPython |
1637475 | <gh_stars>0
# encoding=utf8
import logging
import numpy as np
from niapy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('niapy.algorithms.other')
logger.setLevel('INFO')
__all__ = ['SimulatedAnnealing', 'cool_delta', 'cool_linear']
def cool_delta(current_temperature, delta_... | StarcoderdataPython |
9644874 | import sys
def _encode_string(string: str) -> bytes:
"""Encode a string to utf-8.
This can be used to circumvent the issue of the standard encoding
of a windows console not being utf-8.
See: https://github.com/DanielNoord/pydocstringformatter/issues/13
"""
return string.encode("utf-8")
def ... | StarcoderdataPython |
11372805 | <filename>pointnet2/generate_samples_distributed.py
import argparse
import os
import pdb
import subprocess
from os import listdir
import h5py
import numpy as np
import pickle
def dict_to_command(dictionary, exclude_keys=[]):
command = []
for key in dictionary:
if not key in exclude_keys:
if... | StarcoderdataPython |
9782910 | import pytest
from aiogtts.tokenizer import Tokenizer, symbols
from aiogtts.tokenizer.tokenizer_cases import tone_marks, period_comma, colon, other_punctuation, legacy_all_punctuation
def test_tone_marks():
t = Tokenizer([tone_marks])
_in = 'Lorem? Ipsum!'
_out = ['Lorem?', 'Ipsum!']
assert t.run(_in)... | StarcoderdataPython |
228364 | <gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _... | StarcoderdataPython |
3416109 | import sys, os, socket
from termcolor import colored
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
##
## @brief Class for threading simple server.
##
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
allow_reuse_address = True
prg_lbl = colored('min... | StarcoderdataPython |
1991886 | from calamari_ocr.utils.path import (
split_all_ext,
checkpoint_path,
keep_files_with_same_file_name,
filename,
)
from calamari_ocr.utils.glob import glob_all
| StarcoderdataPython |
1661844 | def dobra(lst):
pos=0
while pos<len(lst):
lst[pos]*=2
pos+=1
valor=[6,3,9,1,2]
dobra(valor)
print(valor) | StarcoderdataPython |
3302065 | <reponame>le717/ibm_jsonx<filename>ibm_jsonx/exceptions.py<gh_stars>0
class JsonxParsingException(Exception):
pass
| StarcoderdataPython |
3202458 | # pylint: disable=missing-docstring
from .fastenum import FastEnum
__all__ = ['FastEnum']
| StarcoderdataPython |
8060545 | from rest_framework import serializers
from my_portal.tooling import models
class ToolConditionSerializer(serializers.ModelSerializer):
class Meta:
model = models.ToolCondition
fields = '__all__'
class ToolSerializer(serializers.ModelSerializer):
class Meta:
model = models.Tool
... | StarcoderdataPython |
6569067 | <filename>components/isceobj/InsarProc/runUpdatePreprocInfo.py
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 California Institute of Technology. ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file excep... | StarcoderdataPython |
46060 | <gh_stars>0
#!/usr/bin/python3
__author__ = 'ziyan.yin'
from threading import Lock
from typing import Dict
from .unit import units
locks: Dict[str, Lock] = dict()
def synchronized(func):
key = f"{repr(func)}"
if key not in locks:
locks[key] = Lock()
def wrapper(*args, **kwargs):
with l... | StarcoderdataPython |
8157636 | # Copyright 2020 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 agreed to... | StarcoderdataPython |
12823469 | codigo, quant_KWh = input().split()
somatorio_consumos = soma_media = cont_media = 0
while codigo != '0':
codigo, quant_KWh = int(codigo), int(quant_KWh)
if codigo == 1: # Residencial
if quant_KWh <= 200:
preco_consumo = quant_KWh * 0.60
else:
preco_consumo = quant_KWh *... | StarcoderdataPython |
308390 | import unittest
import time
import logging
from financescraper.datacontainer import circular_buffer
class TestCircularBuffer(unittest.TestCase):
def setUp(self):
self.buffer = circular_buffer.CircularBuffer(2, 1)
logging.disable(logging.ERROR)
def tearDown(self):
logging.disable(logg... | StarcoderdataPython |
313201 | <gh_stars>10-100
# coding=utf-8
import matplotlib.pyplot as plt
import numpy as np
import pytest
from ..classes import Simulation, PeriodicTestGrid, NonperiodicTestGrid
from ..visualization.time_snapshots import FieldPlot, CurrentPlot
@pytest.fixture(params=(64, 128, 256, 512))
def _NG(request):
return request.p... | StarcoderdataPython |
3207137 | <reponame>Elen-T/python_training<filename>data/contacts.py<gh_stars>0
# отдельный пакет работы с тестовыми данными для теста добавление контакта
from model.contacts import Contacts
testdata = [
Contacts(firstname="firstname1", middlename="middlename1", lastname="lastname1", nickname="nickname1"),
Contacts(firs... | StarcoderdataPython |
9712645 | #!/usr/bin/python3
from storpool.charms.manage import __main__ as spmain
spmain.main()
| StarcoderdataPython |
5104422 | <reponame>Nyquixt/multiview-human-pose-estimation-pytorch
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# -------------------------------------------------------... | StarcoderdataPython |
12843704 | TRAIN_SIZE = 23654
| StarcoderdataPython |
9735697 | <filename>polydown/__main__.py
import argparse
import datetime
from .cli import polycli
__version__ = "0.2.2"
ap = argparse.ArgumentParser()
ap.add_argument(
"asset_type",
type=str,
nargs="*",
help='"hdris, textures, models"',
)
ap.add_argument(
"-f",
"--folder",
action="store",
type=s... | StarcoderdataPython |
4868023 | """Example for solving pose graph optimization problems loaded from `.g2o` files.
For a summary of options:
python pose_graph_g2o.py --help
"""
import dataclasses
import enum
import pathlib
from typing import Dict
import dcargs
import jaxfg
import matplotlib.pyplot as plt
import _g2o_utils
class SolverType(e... | StarcoderdataPython |
294209 | import PySimpleGUI as sg
import global_variables
import get_pdfs
import get_json
import login
import os
import pandas as pd
import requests
import json
CURRENT_DIR = os.path.dirname(__file__)
# This function makes it so when the user selects file paths for the csv, json files, and pdf files,
# their choices will be s... | StarcoderdataPython |
5166430 | <reponame>mkitto/benchmarks
import os
import platform
import socket
import sys
UPPER_BOUND = 5000000
PREFIX = 32338
class Node:
def __init__(self):
self.children = {}
self.terminal = False
class Sieve:
def __init__(self, limit):
self.limit = limit
self.prime = [False] * (lim... | StarcoderdataPython |
371920 | <filename>x_spam.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import timeit
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import containers
from keras.layers.core import Dense, AutoEncoder
from keras.layers.noise import GaussianNois... | StarcoderdataPython |
6492427 | <reponame>arajajyothibabu/PythonLearning
__author__ = 'Kalyan'
max_marks = 35 # 15 marks for encode and 20 for decode
problem_notes ='''
This problem deals with number conversion into a custom base 5 notation and back.
In this notation, the letters a to e are used for digits 0 to 4.
E.g. decimal 10 in this custom... | StarcoderdataPython |
3224026 | <filename>kaggle/decision_tree.py
#!/usr/bin/env python3
import pandas as pd
import pydotplus
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, export_graphviz
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
from sklearn.externals.s... | StarcoderdataPython |
4931991 | <reponame>ch1huizong/learning
def somename(self, *args):
## ...some preliminary task...
try:
super_method = super(cls, self).somename
except AttributeError:
return None
else:
return super_method(*args)
| StarcoderdataPython |
4815675 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def function(number):
def function_2():
return number + 3
return function_2()
if __name__ == '__main__':
k = float(input("Введите число: "))
cnt = function(k)
print(cnt)
| StarcoderdataPython |
3242541 | <filename>kili423/kili423.py
#!/usr/bin/python3.1
import sys
src = sys.argv[1]
dst = src.replace(".kicad_mod","old.kicad_mod")
with open(src,'r') as f:
srcMod = f.read();
srcMod = srcMod.replace('F.Fab','Eco1.User')
srcMod = srcMod.replace('B.Fab','Eco1.User')
srcMod = srcMod.replace('F.CrtYd','Eco2.User')
srcMod ... | StarcoderdataPython |
3286040 | # pretty printing for stage 2.
# put "source /path/to/stage2_gdb_pretty_printers.py" in ~/.gdbinit to load it automatically.
import re
import gdb.printing
class TypePrinter:
no_payload_count = 4096
# Keep in sync with src/type.zig
# Types which have no payload do not need to be entered here.
payload_t... | StarcoderdataPython |
3533921 | def generate_all_subset(list_, toggles, i):
if i == len(list_):
res = []
for idx in range(len(toggles)):
if toggles[idx] == 1:
res.append(list_[idx])
print(res)
else:
toggles[i] = 0
generate_all_subset(list_, toggles, i + 1)
toggles[i... | StarcoderdataPython |
8146948 | <reponame>gary-beautypie/pipelinewise-target-snowflake<filename>tests/unit/test_flattening.py
import unittest
import target_snowflake.flattening as flattening
class TestFlattening(unittest.TestCase):
def setUp(self):
self.config = {}
def test_flatten_schema(self):
"""Test flattening of SCHE... | StarcoderdataPython |
9636444 | from datetime import datetime
from cleo.commands.command import Command
from cleo.helpers import argument, option
from poetry.core.version.exceptions import InvalidVersion
from poetry.poetry import Poetry
from poetry_release.git import Git
from poetry_release.exception import UpdateVersionError
from poetry_release.re... | StarcoderdataPython |
6638079 | <reponame>Open-Innovation-Platform-OIP/contentready_oip
from __future__ import unicode_literals
import frappe
def get_context(context):
context.title = context.doc.full_name
return context
| StarcoderdataPython |
4832757 | def do(i):
return i+2 | StarcoderdataPython |
3472561 | '''Testing beetools__init__()'''
from pathlib import Path
from beetools.beearchiver import Archiver
import beetools
_PROJ_DESC = __doc__.split('\n')[0]
_PROJ_PATH = Path(__file__)
def project_desc():
return _PROJ_DESC
b_tls = Archiver(_PROJ_DESC, _PROJ_PATH)
class TestBEETools:
def t... | StarcoderdataPython |
11282913 | <filename>examples/botexample.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""A simple bot script.
This sample script leverages web.py (see http://webpy.org/). By default the
web server will be reachable at port 8080 - append a different port when
launching the script if desired. ngrok can be used to tunnel tr... | StarcoderdataPython |
3226769 | <gh_stars>1-10
#!/usr/bin/env python
"""
Usage: thingpin -h
thingpin [options] run
thingpin create-config
thingpin [options] install-service
Monitor GPIO pins and update AWS IoT via MQTT.
Arguments:
run run the thingpin monitor
create-config generate sample YAML thingpin-... | StarcoderdataPython |
8151292 | points = 0
print("What is the land velocity of an unladen swallow? ")
print("a)50 kph")
print("b)9001 kph")
print("c)African or European?")
answer = input(">>> ").lower()
if answer == "c":
print("Good Job!!")
points = points + 20
else:
print("got to KnowYourMeme.com--you're out of touch")
## < > <= >= !=... | StarcoderdataPython |
8083608 | import os
import cv2
import tensorflow as tf
import numpy as np
from tqdm import tqdm
from test_single_img import load_model_and_label, pred_single
load_model_and_label()
IMAGE_DIR = 'net/need_tagged/'
NPY_DIR = 'net/predictions/'
for file_name in tqdm(os.listdir(IMAGE_DIR)):
img = cv2.imread(os.path.join(IMAGE_... | StarcoderdataPython |
11276536 | import sys
rep_word = ['temp']
rep_word2 = ["frequency"]
with open(sys.argv[1]) as oldfile, open("temp-out.csv","w") as newfile_temp:
for line in oldfile:
if any(bad_word in line for bad_word in rep_word):
newfile_temp.write(line)
with open(sys.argv[1]) as oldfile, open("frequency.csv","w") as ... | StarcoderdataPython |
3494904 | <gh_stars>1-10
from django.apps import AppConfig
class ElgamalreConfig(AppConfig):
name = 'elgamalre'
| StarcoderdataPython |
347794 | # 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... | StarcoderdataPython |
1822546 | #!/usr/bin/env python
# encoding: utf-8
from .views import auth_bp
| StarcoderdataPython |
3354140 | <reponame>wookayin/acme
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | StarcoderdataPython |
297184 | import numpy as np
# import re
import pickle
from keras.models import load_model
from keras.preprocessing import text, sequence
from keras.preprocessing.sequence import pad_sequences
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from lime.lime_text import LimeTextExplainer
impo... | StarcoderdataPython |
6415005 | <filename>Design/chanwoo/loststars/controller.py
import db
import button_maker as button
import random
def show_userinfo(bot):
result = db.get_userinfo("telegram",str(bot.chat_id))
text = '''{}님이 입력하신 정보는 아래와 같습니다\n성별 : {}\n나이 : {}\n여행지 : {}\n여행기간 : {}\n여행정보 : {}\n카카오id : {}\n''' \
.format(bot.name,... | StarcoderdataPython |
8005298 | import datetime as dt
import unittest
import pandas as pd
import numpy as np
import numpy.testing as npt
import seaice.nasateam as nt
import seaice.tools.plotter.daily_extent as de
class Test_BoundingDateRange(unittest.TestCase):
def test_standard(self):
today = dt.date(2015, 9, 22)
month_bound... | StarcoderdataPython |
1612109 | import requests
from requests.auth import HTTPDigestAuth
from atlascli.atlaskey import AtlasKey
key=AtlasKey.get_from_env()
try:
r = requests.get("https://cloud.mongodb.com/api/atlas/v1.0/groups",
headers={"Accept": "application/json",
"Content-Type": "applicatio... | StarcoderdataPython |
3347028 | <filename>app/honey/applications/example.py
from app.honey.standard import Standard
"""
首先应用目录下需要有build.json内容包括
{
'entry':'',
'requirement':''
}
"""
class AppNameClass(Standard):
def app_info(self, **kwargs):
"""重写此方法"""
self.name = kwargs.get('name', "desktop") # 应用名称
self.d... | StarcoderdataPython |
9703003 | <filename>scripts/atrfu/example_time_analysis.py
from datetime import datetime
from the_candidate_generation import compute_entity_ranks_relfreqs
from lxml import etree
import os
from glob import glob
import pickle
def get_wid2w(doc):
"""
"""
wid2w = {wf_el.get('id'): wf_el.text
for wf_el in ... | StarcoderdataPython |
3381495 | import pytest
from teste_op import somar
from teste_op import subtrair
def test_somar():
assert somar(2, 3) == 5
def test_subtrair():
assert subtrair(2, 3) == -1 | StarcoderdataPython |
1697903 | import appdaemon.plugins.hass.hassapi as hass
import pytest
from cx_core.controller import Controller
from tests.test_utils import fake_async_function
@pytest.fixture(autouse=True)
def hass_mock(monkeypatch, mocker):
"""
Fixture for set up the tests, mocking appdaemon functions
"""
def fake_fn(*args... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.