id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
6566317 | <reponame>kayarre/pyNS
#!/usr/bin/env python
## Program: PyNS
## Module: ModelAdaptor.py
## Language: Python
## Date: $Date: 2012/09/04 10:21:12 $
## Version: $Revision: 0.4.2 $
## Copyright (c) <NAME>, <NAME>. All rights reserved.
## See LICENCE file for details.
## This software is distributed W... | StarcoderdataPython |
355197 | # Generated by Django 3.2.6 on 2022-04-06 06:59
import apps.home.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('home', '0004_quranchapterold'),
]
operations = [
migrations.CreateModel(
... | StarcoderdataPython |
12820297 | <gh_stars>0
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Page
from ._markups import get_all_markups
from .settings import WALIKI_CODEMIRROR_SETTINGS as CM_SETTINGS
class DeleteForm(forms.Form):
what = forms.ChoiceField(label=_('What do you want to delete?'),... | StarcoderdataPython |
5061282 | <reponame>Garee/CREATe
import sqlite3
import json
conn = sqlite3.connect('database.sqlite')
c = conn.cursor()
conn.row_factory = sqlite3.Row
data = conn.execute('''SELECT p.page_id AS "page_id",
p.page_title,
r.rev_text_id AS "revision_id",
t.old_id AS "text_id",
t.old_text
FROM
page p
INNER JOIN revision r
... | StarcoderdataPython |
3269243 | from output.models.ms_data.regex.schema_i_xsd.schema_i import Doc
__all__ = [
"Doc",
]
| StarcoderdataPython |
1747207 | <gh_stars>0
#!/usr/bin/env python
from setuptools import setup
setup(
name = 'chipshouter',
version = '1.0.0',
description = "ChipSHOUTER EMFI API",
author = "<NAME>",
author_email = '<EMAIL>',
license = 'GPLv3',
url = 'http://www.ChipSHOUTER.com',
download_url='https://github.com/newa... | StarcoderdataPython |
3506440 | <reponame>zhangjq933/HowtoSim_Script
def buildBlock(x,y,z,oDesktop):
oProject = oDesktop.GetActiveProject()
oDesign = oProject.GetActiveDesign()
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateBox(
[
"NAME:BoxParameters",
"XPosition:=" , "0mm",
... | StarcoderdataPython |
8068245 | # Field class (relativistic) for OLIVE
#
# Class is initialized with an array of modes and amplitudes as well as corresponding metadata
#
#
# Units
# -Assume CGS units for now
#
import numpy as np
from scipy.constants import c as c_mks
c = c_mks*1.e2
class Field(object):
def __init__(self, cavity):
""... | StarcoderdataPython |
1917333 | <filename>main2.py
import i2v
from PIL import Image
import os
hair_list = ['blonde hair', 'brown hair', 'black hair', 'blue hair', 'pink hair' ,'purple hair', 'green hair','red hair', 'silver hair', 'white hair', 'orange hair', 'aqua hair', 'gray hair']
eye_list = ['blue eyes', 'red eyes', 'brown eyes' ,'green eyes... | StarcoderdataPython |
217271 | <filename>venv/lib/python3.6/site-packages/ansible_collections/ngine_io/vultr/plugins/modules/vultr_plan_baremetal_info.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, <NAME> <<EMAIL>>
# (c) 2020, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
f... | StarcoderdataPython |
8098579 | <filename>examples/create_scripts/extracellular_spikes.py
#!/usr/bin/python
import sys
import numpy as np
from nwb import nwb_file
from nwb import nwb_utils as ut
"""
Store extracellular ephys data
"""
OUTPUT_DIR = "../created_nwb_files/"
file_name = __file__[0:-3] + ".nwb"
#########################################... | StarcoderdataPython |
6486676 |
from pyvisdk.esxcli.executer import execute_soap
from pyvisdk.esxcli.base import Base
class NetworkIpInterfaceIpv6Address(Base):
'''
Commands to list and update IPv6 addresses assigned to the system.
'''
moid = 'ha-cli-handler-network-ip-interface-ipv6-address'
def add(self, interfacename, ipv6):
... | StarcoderdataPython |
158689 | """Argument parser for training pipelines."""
import dataclasses
import re
from argparse import ArgumentTypeError
from enum import Enum
from functools import partial
from typing import Any, List, NewType, Optional, Type, Union
from transformers import HfArgumentParser
def none_checker_bool(val: Union[bool, str]) -... | StarcoderdataPython |
9675560 | #!/usr/bin/env python
from __future__ import print_function
import sys
import time
import random
def write(data):
sys.stdout.write(data + '\n')
sys.stdout.flush()
def main():
if len(sys.argv) < 2:
print("%s <number of routes> <updates per second thereafter>")
sys.exit(1)
initial = ... | StarcoderdataPython |
8184429 | <reponame>Maastro-CDS-Imaging-Group/SQLite4Radiomics
from logic.entities.ct_series import CtSeries
from test.mock_ups.logic.entities.series_with_image_slices import SeriesWithImageSlicesMockUp
class CtSeriesMockUp(CtSeries, SeriesWithImageSlicesMockUp):
pass
| StarcoderdataPython |
9773156 | import os, sys, time
print sys.argv
# Testing with large input.
imagesToCreate = int(sys.argv[1])
imageList = []
missingImages = []
print 'Creating images...'
for num in range(0, imagesToCreate):
print 'Creating picture #' + str(num)
os.system('cp testimage.jpg ../watch-folder/testimage' + str(num) + '.jpg')
... | StarcoderdataPython |
345245 | <reponame>wcastello/splunk-sdk-python
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | StarcoderdataPython |
115071 | '''
Library for 2-component Flory-Huggings theory.
Author: <NAME>
Date created: 23 March 2022
'''
import numpy as np
def help():
print('Here are the list of functions included in FH.py:\n')
print(' critical(n = 1): returns the critical concentration and critical interaction [phi_c, chi_c]\n')
print(' spinodal(c... | StarcoderdataPython |
5131383 | from mcpi.minecraft import Minecraft
import time
import random
mc=Minecraft.create() #set create function to mc
blockType = 3 # set blocktype number (grass, lava, etc...)
amount = 33
steps= 0
hungry = 0
# code to have pet blocky follow you around!!!
pos =mc.player.getPos() # get player position
mc.setBlock(pos.x+2... | StarcoderdataPython |
3436719 | <filename>test/test_run.py
import sys
if int(sys.version.split(".")[1]) < 6:
# python 3.5
pass
else:
from tools import data
from tools import exceptions
from tools import utils
from unittest import mock
import anndata
import numpy as np
import pandas as pd
import re
import ... | StarcoderdataPython |
1722421 | <filename>test/unit_tests/protocol/mpwp_protocol_test.py
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
import unittest
from server_common import mpwp_protocol
class Mpwp_Protocol_TestCas... | StarcoderdataPython |
47389 | from app import app
import unittest
import base64
import json
class TestLogin(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.app = app.test_client()
self.user_name = "<EMAIL>"
self.password = "<PASSWORD>"
self.valid_credentials = base64.b64encode(b'<... | StarcoderdataPython |
12835294 | <gh_stars>10-100
import sys
try:
import pefile
except ImportError:
print 'You have to install pefile (pip install pefile)'
sys.exit()
def main():
if len(sys.argv) < 2:
print 'usage: dumpsec.py program.exe'
return
pe = pefile.PE(sys.argv[1], fast_load=True)
data = pe.get_memory_mapped_image()
... | StarcoderdataPython |
371462 | # --- coding:utf-8 ---
# author: Cyberfish time:2021/7/23
from ner_code.predict import NerPredict
from intent_code.predict import IntentPredict
from biclass_code.predict import BiPredict
from database_code.database_main import DataBase
from agent import Agent
from collections import defaultdict
intent_predict = Intent... | StarcoderdataPython |
6695249 | <filename>src/run.py
from Transactioner import Transactioner
class TestDbInitializer:
#def __init__(self):
# self.__t = Transactioner('sqlite:///../res/test.db')
# self.__t.Execute()
#@t.Execute
#@transact('sqlite:///../res/test.db')
def initialize(self, db, *args, **kwargs):
pri... | StarcoderdataPython |
1790828 | <reponame>mariogeiger/se3cnn
# pylint: disable=C,R,E1101
import torch
import os
import numpy as np
from scipy.stats import special_ortho_group
class Cath(torch.utils.data.Dataset):
url = 'https://github.com/deepfold/cath_datasets/blob/master/{}?raw=true'
def __init__(self, dataset, split, download=False,
... | StarcoderdataPython |
9738409 | <filename>tests/unit/tst_16.py
from __future__ import division
import iotbx.pdb
import os
from scitbx.array_family import flex
from libtbx import easy_pickle
import time
import run_tests
from libtbx.test_utils import approx_equal
import libtbx.load_env
qrefine = libtbx.env.find_in_repositories("qrefine")
qr_unit_tests... | StarcoderdataPython |
9679982 | <filename>Phidgets22.indigoPlugin/Contents/Server Plugin/plugin.py<gh_stars>0
# -*- coding: utf-8 -*-
import indigo
import logging
import traceback
import json
# Phidget libraries
from Phidget22.Devices.Log import Log
from Phidget22.Net import Net, PhidgetServerType
from Phidget22.Phidget import Phidget
from Phidget2... | StarcoderdataPython |
6691464 | <reponame>omiguelperez/python-restful-web-bdd<filename>app/application.py
# -*- coding: utf-8 -*-
from flask import Flask, request, jsonify, Response
app = Flask(__name__)
USERS = {}
GET = 'GET'
POST = 'POST'
DELETE = 'DELETE'
PUT = 'PUT'
@app.route('/user/list', methods=[GET])
def list_users():
if request.m... | StarcoderdataPython |
6619814 | # ::: Tuple :::
# tuple is just like list but read only
# almost all the thing is judt like list.
# defining a tuple
marks = (454, 657, 587, 345, 893) # just like list, only '[]' to '()'
marks = 454, 657, 587, 345, 893 # python will take it as a tuple
marks = tuple("Helo World")
# unpacking
marks = [45, 63, 96]
... | StarcoderdataPython |
226974 | <reponame>CherBoon/Cloudtopus
from django.conf import settings
from django.contrib.auth.hashers import check_password
from django.contrib.auth.models import User
from Module_TeamManagement.models import Student, Faculty, Class, Course_Section, Course
#----------------------------------------------------------------... | StarcoderdataPython |
3354889 | #Example code
import YassaAlchemy #import library
db = YassaAlchemy.table(host="localhost",user="root",passwd="<PASSWORD>",database="yassadb")
#create instance of YassaAlchemy
#make sure a database is created and insert
#the neccesary credentials
class Users:
#make static class
#class for Users
def ... | StarcoderdataPython |
5020424 | <reponame>godontop/python-work<gh_stars>0
# -*- coding: utf-8 -*-
class FunctionalList(object):
"""实现了内置类型list的功能,并丰富了一些其他方法:head,tail,init,last,
drop,take"""
def __init__(self, values=None):
if values is None:
self.values = []
else:
self.values = values
def __l... | StarcoderdataPython |
5089730 | <reponame>sannithibalaji/cloudlift<gh_stars>0
import functools
import boto3
import click
from botocore.exceptions import ClientError
from cloudlift.config import highlight_production
from cloudlift.deployment.configs import deduce_name
from cloudlift.deployment import EnvironmentCreator, editor
from cloudlift.config.... | StarcoderdataPython |
1822398 | <gh_stars>0
import pytest
import os
import sys
import json
import math
import torch
import torch.distributed as dist
import torch.nn.functional as F
from fmoe.functions import ensure_comm
from test_ddp import _ensure_initialized, _run_distributed
from test_numerical import _assert_numerical
from fmoe.fastermoe.schedu... | StarcoderdataPython |
6473964 | <reponame>movingpictures83/SequenceLength
class SequenceLengthPlugin:
def input(self, filename):
self.fasta = open(filename, 'r')
def run(self):
pass
def output(self, filename):
lineno = 1
totallen = 0
numseq = 0
for line in self.fasta:
if (lineno % 2... | StarcoderdataPython |
6520280 | <filename>tests/test_blobstash_base.py
import os
import pytest
from blobstash.base.blobstore import Blob, BlobNotFoundError, BlobStoreClient
from blobstash.base.client import Client
from blobstash.base.kvstore import KVStoreClient
from blobstash.base.test_utils import BlobStash
def test_test_utils():
"""Ensure ... | StarcoderdataPython |
6505329 | <gh_stars>10-100
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
#At a minimum you will need username,
default_shib_attributes = {
"REMOTE_USER": (True, "username"),
}
SHIB_ATTRIBUTE_MAP = getattr(settings, 'SHIBBOLETH_ATTRIBUTE_MAP', default_shib_attributes)
#Set to true... | StarcoderdataPython |
11211981 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | StarcoderdataPython |
346341 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from telethon.tl.functions.messages import SaveDraftRequest
from FIREX.utils import admin_cmd, sudo_cmd
from userbot.cmd... | StarcoderdataPython |
11249952 | from exo.exocore import ExoCore
API_KEY = "" #Enzoic API Key here
SECRET_KEY = "" #Enzoic Secret Key here
exo = ExoCore(API_KEY, SECRET_KEY)
result = exo.results("abc123@12")
print(result)
| StarcoderdataPython |
1849425 | def cut(s):
from itertools import islice
try:
it, b2n = iter(s), lambda b: int(''.join(next(it) for _ in range(b)), 2)
version, type_id = b2n(3), b2n(3)
except RuntimeError: return
if type_id == 4: # Literal
read, bits = '1', []
while read == '1':
read, *chun... | StarcoderdataPython |
3571078 | <gh_stars>0
class Historian():
def __init__(self):
self.history = []
self.history_index = -1
self.history_max_index = -1
self.temp_undo = []
self.temp_redo = []
empty_func = lambda: None
self.callback_enable_undo = empty_func
self.callback_enable_red... | StarcoderdataPython |
11210471 | import neutromeratio
import sys
import torch
from neutromeratio.constants import initialize_NUM_PROC
from neutromeratio.parameter_gradients import (
setup_and_perform_parameter_retraining_with_test_set_split,
)
def run():
initialize_NUM_PROC(4)
assert len(sys.argv) == 10
env = sys.argv[1]
element... | StarcoderdataPython |
3259250 | #!/usr/bin/env python
import os
import sys
import time
import json
LOG_FILEPATH = "/tmp/onenote.log"
NOTES_ANNOTATION_DESCRIPTION = "[Notes]"
DEBUG = "ONENOTE_DEBUG" in os.environ
def log(message):
if DEBUG:
with open(LOG_FILEPATH, 'a') as logfile:
logfile.write("%s\n" % message)
def to_iso_string(time_... | StarcoderdataPython |
3261891 | # Generated by Django 3.1 on 2020-10-07 15:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projectmanager', '0044_auto_20201007_1844'),
]
operations = [
migrations.AddField(
model_name='materialinstock',
name=... | StarcoderdataPython |
9688869 | <reponame>ynohat/bossman<gh_stars>1-10
import sys
from bossman.errors import BossmanValidationError
from os import getcwd
import git
import argparse
from rich import print
from rich.table import Table
from bossman import Bossman
def init(subparsers: argparse._SubParsersAction):
parser = subparsers.add_parser("valida... | StarcoderdataPython |
209498 | <gh_stars>0
import numpy as np
import kmeans
import common
import naive_em
import em
X = np.loadtxt("toy_data.txt")
########## Begin: kMeans vs EM (and BIC) #############
K = [1, 2, 3, 4] # Clusters to try
seeds = [0, 1, 2, 3, 4] # Seeds to try
# Costs for diff. seeds
costs_kMeans = [0, 0, 0, 0, 0]
costs_EM =... | StarcoderdataPython |
9777665 | <filename>models_with_cam.py
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from torch.nn import functional as F
import torch
from torch.autograd import Variable
__all__ = ['ResNet', 'resnet18']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth'... | StarcoderdataPython |
11331804 | """
Neighbor lists are used to obtain the indices of neighbors surrounding an atom
for the :obj:`schnetpack.md.calculators.SchnetPackCalculator`.
Currently only a primitive version of a neighbor list is implemented, which cannot deal
with periodic boundary conditions and does not possess optimal scaling for large syste... | StarcoderdataPython |
9702964 | <reponame>Kaiyuan-Zhang/Gravel-public<filename>specs/lb_rw.py<gh_stars>1-10
from gravel_spec.utils import *
from gravel_spec.ops import *
from gravel_spec.element import *
from gravel_spec.graph import *
from gravel_spec.config import *
class IPFilter(Element):
ele_name = 'IPFilter'
num_in_ports = 1
num_o... | StarcoderdataPython |
12846173 | import json
import logging
from binance.helpers import round_step_size
from sqlalchemy import false
from ..enums import *
import bson
import abc
import itertools
from ..objects import EState, EOrderType, ECommand, EnhancedJSONEncoder
from ..utils import safe_sum, round_step_downward, truncate, safe_multiply, safe_subst... | StarcoderdataPython |
8140543 | import math
from . import _catboost
from .core import CatBoost, CatBoostError
from .utils import _import_matplotlib
FeatureExplanation = _catboost.FeatureExplanation
def _check_model(model):
if not isinstance(model, CatBoost):
raise CatBoostError("Model should be CatBoost")
def to_polynom(model):
... | StarcoderdataPython |
6458098 | <reponame>apoveda25/graphql-python-server
import os
from dotenv import load_dotenv
class Environment:
def __init__(self, path: str = "/.env"):
self.get_file_env(path)
def get_file_env(self, path: str):
self.reload(os.getcwd() + path)
def reload(self, env_path: str):
load_dotenv(d... | StarcoderdataPython |
6678534 | import pandas as pd
import torch
from sklearn.metrics import f1_score, precision_score, recall_score, classification_report
from torch.autograd import Variable
from tqdm import tqdm
from models.MRNet_2D import MRNet_2D
from models.MRNet import MRNet
from mri_dataset.mri_3d_pkl_dataset import MRI_3D_PKL_Dataset
from mr... | StarcoderdataPython |
1973697 | from experiments import research, data
| StarcoderdataPython |
4839170 | <filename>datacube/index/_datasets.py
# coding=utf-8
"""
API for dataset indexing, access and search.
"""
from __future__ import absolute_import
import logging
from cachetools.func import lru_cache
from datacube import compat
from datacube.model import Dataset, DatasetType, MetadataType
from datacube.utils import In... | StarcoderdataPython |
6479798 | <filename>thumbnail_OpenFaaS/thumbnail/handler.py
from PIL import Image
import cgi
import io
import os
def handle(param):
# Fetch the HTTP request body from the function input.
bin_data = param
bin_length = len(bin_data)
# Convert it into a binary stream
bin_stream = io.BytesIO(bin_data)
# F... | StarcoderdataPython |
5156326 | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.db import models
from django.utils.html import linebreaks
from django.utils.translation import ugettext as _
from zinnia.markups import textile
from zinnia.markups import markdown
fro... | StarcoderdataPython |
82123 | import re
import datetime
from Constants import *
from ..Hashes import *
from StringUtils import *
from TimeZoneUtils import *
from ..ScheduleEvent import *
from .Scraper import *
def SupplementSchedule(sched, navigator, sport, league, season):
supplement = ScrapeAllStarGame(sport, league, seas... | StarcoderdataPython |
4861471 | import dataset.cars196
import dataset.cub200
import dataset.stanford_online_products
def select(dataset, opt, data_path, TrainDatasetClass=None):
if 'cub200' in dataset:
return cub200.get_dataset(opt, data_path, TrainDatasetClass)
if 'cars196' in dataset:
return cars196.get_dataset(opt, data_... | StarcoderdataPython |
1928044 | from __future__ import print_function, division
from warnings import warn
from nilmtk.disaggregate import Disaggregator
from keras.layers import Conv1D, Dense, Dropout, Reshape, Flatten
import os
import pickle
import pandas as pd
import numpy as np
from collections import OrderedDict
from keras.optimizers import SGD
fr... | StarcoderdataPython |
1623021 | """
Tests for vertex.py
"""
from graphpy.edge import UndirectedEdge, DirectedEdge
from graphpy.vertex import UndirectedVertex, DirectedVertex
import unittest
################################################################################
# ... | StarcoderdataPython |
11394653 | <gh_stars>0
from src.job.compute.managers.pbs import PBSComputeParser
from src.job.compute.managers.slurm import SLURMComputeParser
def get_compute_parser(name, work_dir):
"""
Returns an instance of compute parser class
Args:
name (str): parser name, PBS or SLURM.
work_dir (str): full pat... | StarcoderdataPython |
3277928 | <reponame>ltowarek/budget-supervisor
# coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
... | StarcoderdataPython |
6585954 | numbers = [1, 6, 8, 1, 2, 1, 5, 6]
input_number = int(input("Enter a number: "))
occurs = 0
for i in numbers:
if input_number == i:
occurs += 1
print("{} appears {} time(s) in my list.".format(input_number,occurs))
| StarcoderdataPython |
1815237 | from datetime import datetime, timezone
from typing import Union, List, Dict, Tuple
from .covidstatistics import *
from .exceptions import NotFound, BadSortParameter, BadYesterdayParameter, BadTwoDaysAgoParameter, BadAllowNoneParameter
from .covidendpoints import *
class Covid:
"""
Handles interactions with t... | StarcoderdataPython |
11343941 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 16:47:57 2019
@author: created by David on June 13 2020
"""
def warn(*args, **kwargs):
pass
import warnings, sys, os
warnings.warn = warn
import matplotlib; matplotlib.use('agg') #for server
import matplotlib.pyplot as plt
import seaborn as s... | StarcoderdataPython |
11288268 | # -*- coding: utf-8 -*-
"""
@Author: Shaoweihua.Liu
@Contact: <EMAIL>
@Site: github.com/liushaoweihua
@File: models.py
@Time: 2020/3/13 03:58 PM
"""
import sys
sys.path.append("../..")
from keras_bert_kbqa.train import train
from keras_bert_kbqa.helper import train_args_parser
def run_train():
args = train_ar... | StarcoderdataPython |
5055568 | import pygame
from pygame.locals import *
import math
import sys
import os
import threading
import random
import time
import collections
# One boundary point known
def make_circle(points, p):
c = (p[0], p[1], 0.0)
for (i, q) in enumerate(points):
if not _is_in_circle(c, q):
if c[2] == 0.0:
... | StarcoderdataPython |
4833818 | import json
import os
import re
import shutil
import sys
import tempfile
import time
import pygame
import subprocess
from pgu import gui
from pygame.locals import *
from Constants import *
from Logger import logger
from pgu.gui import Theme
from surfaces.LeftMenu import LeftMenu
from surfaces.MainArea import MainArea... | StarcoderdataPython |
3214499 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2020 Scriptim (https://github.com/Scriptim)
#
# 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 limitati... | StarcoderdataPython |
3313504 | import macropy.activate
import testBattleship
| StarcoderdataPython |
8078152 | <reponame>sparcs-kaist/araplus
from django.contrib import admin
from apps.session.models import UserProfile, Message,\
GroupMessage, Block, Group
class UserProfileAdmin(admin.ModelAdmin):
list_display = ('user', 'nickname', 'points')
class MessageAdmin(admin.ModelAdmin):
list_display = ('content', 'send... | StarcoderdataPython |
9771677 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, Post, Tag, Image
# Register your models here.
class PostModelAdmin(admin.ModelAdmin):
list_filter = ('sites',)
list_display = ('title', 'in_sites',)
class TagModelAdmin(admin.ModelAdmin):
list_fil... | StarcoderdataPython |
1996362 | from importlib import import_module
from collections import defaultdict
from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
__all__ = [
'city_types','district_types',
'import_opts','import_opts_all','HookException','settings'
]
url_bases = {
'geo... | StarcoderdataPython |
4959742 | <filename>tdrs-backend/tdpservice/data_files/migrations/0006_datafile_file.py
# Generated by Django 3.2.3 on 2021-05-24 19:06
from django.db import migrations, models
import tdpservice.data_files.models
class Migration(migrations.Migration):
replaces = [('reports','0006_reportfile_file')]
dependencies = [
... | StarcoderdataPython |
283109 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.shortcuts import render
from .models import Products
def index(request):
p = Products.objects.all()
products = {"products" : p}
return render(request, 'products/index.html', products)
def details(request, product_id):
pr... | StarcoderdataPython |
1694546 | <filename>torchcv/engine/__init__.py
from .preprocess import PREPROCESS_ENGINE
| StarcoderdataPython |
1886721 | <reponame>scottwedge/OpenStack-Stein
#
# 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 o... | StarcoderdataPython |
1788723 | """
Filename: financial.py
Author: <NAME>
Current Status: In Development
"""
__author__ = "<NAME>"
__version__ = "1.000"
import openpyxl
import os
import time
import mysql.connector as mysql
from openpyxl.utils import column_index_from_string
from cellStyle import *
import sshtunnel
class ExcelSheet():
def __ini... | StarcoderdataPython |
6583601 | # by amounra 0216 : http://www.aumhaa.com
# written against Live 9.6 release on 021516
from ableton.v2.control_surface.elements.color import Color
from aumhaa.v2.livid.colors import *
"""
Base_Map.py
Created by amounra on 2014-7-26.
This file allows the reassignment of the controls from their default arrangement. ... | StarcoderdataPython |
9794567 | from mkapi.core.base import Base, Inline
from mkapi.core.inherit import is_complete
from mkapi.core.node import Node
def test_is_complete():
assert is_complete(Node(Base))
assert not is_complete(Node(Inline))
| StarcoderdataPython |
8070390 | """
Напишете функция `date_is_valid`,
която приема дата под формата на: година, месец, ден, час, минута, секунда;
и връща `True` ако датата е влидна и `False` в противен случай.
```python
>>> data_is_valid(2015, 1, 2, 23, 20, 10)
True
>>> data_is_valid(2015, 2, 29, 12, 10, 10)
False
>>> data_is_valid(2012, 2, 29, 12, ... | StarcoderdataPython |
1888798 | <filename>EVBE/EVBFile.py
#-*- coding: utf-8 -*-
"""
Copyright (C) 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 limitation the... | StarcoderdataPython |
1776484 | # attempting to implement the parametric equations of a cone
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# from http://mathworld.wolfram.com/Cone.html
h = 1
r = 1 # r is a constant
u = np.linspace(0,h)
tht = np.linspace(0,2*np.pi)
x = ((h-u)/(h))*r*np.cos(tht)
y = ((h-u)/... | StarcoderdataPython |
1608571 | """this file router for recipes page."""
from app import app
from db.db_queries.get_recipe_for_page_query import get_recipes_for_page
from flask import render_template
@app.route('/recipes')
def recipes():
"""Router for recipes page."""
recipes = get_recipes_for_page()
return render_template('recipes.h... | StarcoderdataPython |
5034037 | <reponame>nanodust/BregmanToolkit<gh_stars>10-100
"""
wtcmatrix - convert list of scores into matrix form
Requires:
Music21 version 1.4.0+ - web.mit.edu/music21/
BregmanToolkit - https://github.com/bregmanstudio/BregmanToolkit
2015, <NAME>, Dartmouth College, Bregman Media Labs
... | StarcoderdataPython |
1715985 | class TestData:
CHROME_EXECUTABLE_PATH = "/Users/User/Desktop/selenium/selinium/python chromedriver/chromedriver"
FIREFOX_EXECUTABLE_PATH = "/Users/User/Desktop/selenium/selinium/python chromedriver/geckodriver"
BASE_URL = "https://app.hubspot.com/login"
"""https://app.hubspot.com/login... | StarcoderdataPython |
8102102 | import runonce
import time
import os
import random
lockname = "seattletestlock"
runonce.getprocesslock(str(os.getpid()))
print "my process id is:"+str(os.getpid())
retval = runonce.getprocesslock(lockname)
if retval == True:
print "I have the mutex"
elif retval == False:
print "Another process has the mutex (o... | StarcoderdataPython |
4973635 | <reponame>jayhardikar/oci-data-science-ai-samples
import oci
import argparse
import time
import configparser
import os
import sys
from datetime import datetime, timedelta
# --- Set up
config_file = "~/.oci/config"
CONFIG_FILE = ""
ENV_TYPE = ""
class MLJobs:
def __init__(self, env_type, config_file, compartment_i... | StarcoderdataPython |
1944473 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | StarcoderdataPython |
1858285 | import logging
from appium import webdriver
from appium.webdriver.common import touch_action
from selenium.webdriver.common.by import By
logger = logging.getLogger(__name__)
class DummyList(dict):
def __init__(self, original: list):
super().__init__()
self._original = original
def __missing... | StarcoderdataPython |
1720 | import requests
import aiohttp
from constants import API_KEY
class User(object):
def __init__(self, author_info):
# "author": {
# "about": "",
# "avatar": {
# "cache": "//a.disquscdn.com/1519942534/images/noavatar92.png",
# ... | StarcoderdataPython |
3261808 | import threading
from typing import Callable, Optional
class RepeatingTimer:
def __init__(self, interval_ms: int, func: Callable, *args, **kwargs) -> None:
self.interval_s = interval_ms / 1000
self.func = func
self.args = args
self.kwargs = kwargs
self.timer = None # type:... | StarcoderdataPython |
6479845 | <gh_stars>0
import json
with open('cat_to_name.json', 'r') as f:
cat_to_name = json.load(f)
print(cat_to_name) | StarcoderdataPython |
12835644 | <filename>Set/1.Create-Define-a-aset.py
myset ={"C","C++","Python","Shap","Ruby","Java"}
print("Set Content:",myset) | StarcoderdataPython |
14597 | <gh_stars>0
#!/usr/bin/env python3
import json
import time
import sys
#import numpy as np
import cv2
from cscore import CameraServer, VideoSource, CvSource, VideoMode, CvSink, UsbCamera
from networktables import NetworkTablesInstance
def Track(frame, sd):
Lower = (0,0,0)
Upper = (0,0,0)
if sd.getNumber("T... | StarcoderdataPython |
3578870 | from django.contrib.auth.base_user import BaseUserManager
from django.utils.translation import ugettext_lazy as _
class CustomUserManager(BaseUserManager):
"""
Custom user model where the email address is the unique identifier
and has an is_admin field to allow access to the admin app
"""
def cre... | StarcoderdataPython |
1803783 | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Entry
class EntrySerializer(serializers.ModelSerializer):
class Meta:
model = Entry
fields = ["product", "quantity", "description"]
def to_representation(self, instance):
data = {
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.