id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
3379739 | import django
from myapp.models import Author, Book, Course, Student
# 5.
# a. list all the books int the db
Book.objects.all()
# b. list all the authors int the db
Author.objects.all()
# c. list all the courses int the db
Course.objects.all()
# 6. Write queries to do the following.
# a. List all Authors whose first n... | StarcoderdataPython |
3233127 | <gh_stars>1-10
import validators
import datetime
def allowsNone(f):
def wrapper(element):
if element is None:
return True
return f(element)
return wrapper
def requires_keys(*keys):
def decorator(f):
def wrapper(element):
if not isinstance(element, dict):
return False
for key in keys:
if key ... | StarcoderdataPython |
3294484 | <gh_stars>0
default_app_config = 'greenbudget.app.fringe.apps.FringeConfig'
| StarcoderdataPython |
1703017 | <gh_stars>10-100
word2int_it = {
"Island":4228,
"indossare":2012,
"Rossa":3722,
"Ludovico":4354,
"radicale":2361,
"vetta":3213,
"iniziale":1473,
"incidente":1343,
"finire":515,
"ettaro":4600,
"sotterraneo":3688,
"gas":1643,
"pregare":3761,
"mln":2096,
"estremità":3273,
"maggior":550,
"Germania":776,
"avvolgere":4339,
"... | StarcoderdataPython |
3360944 | from .viedit import ViEdit
version = "0.1.3"
| StarcoderdataPython |
178943 |
import tensorflow as tf
import sys
if __name__ == "__main__":
if len(sys.argv) >= 2:
raw_dataset = tf.data.TFRecordDataset(sys.argv[1])
for raw_record in raw_dataset.take(1):
example = tf.train.Example()
example.ParseFromString(raw_record.numpy())
print(examp... | StarcoderdataPython |
3274185 | <reponame>MUzzell/the_pokemon_api<filename>backend/backend/query_server.py
import re
from .base_server import BaseServer
STATS_REGEX = re.compile("([a-zA-Z0-9]+)([<>=]{1,2})(\\d+)")
class QueryServer(BaseServer):
def __init__(self, query_queue, pokedex):
super(QueryServer, self).__init__(query_queue)
... | StarcoderdataPython |
22525 | <filename>02_crowsnest/ragz_crowsnest.py
#!/usr/bin/env python3
"""
Date : 2021-09-06
Purpose: learning to work with strings
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Crow... | StarcoderdataPython |
1696966 | <gh_stars>0
from __future__ import annotations
from typing import Any, TypeVar, Set, Dict, Tuple, Optional
from grapl_analyzerlib.node_types import (
EdgeT,
PropType,
PropPrimitive,
EdgeRelationship,
)
from grapl_analyzerlib.nodes.entity import EntityQuery, EntityView, EntitySchema
from grapl_analyzerl... | StarcoderdataPython |
3232477 | <filename>src/async_kinesis_client/kinesis_producer.py
import logging
import time
import aioboto3
from .retriable_operations import RetriableKinesisProducer
log = logging.getLogger(__name__.split('.')[-2])
# Following constants are originating from here:
# https://boto3.amazonaws.com/v1/documentation/api/latest/re... | StarcoderdataPython |
3207745 | <reponame>vaibhav0000patel/look-somewhere-else<gh_stars>0
from win32api import *
from win32gui import *
import win32con
import sys, os
import time
from random import randint
class WindowsBalloonTip:
def __init__(self, title, msg):
message_map = {
win32con.WM_DESTROY: self.OnDestroy,
... | StarcoderdataPython |
4837517 | <filename>untypy/impl/dummy_delayed.py
from typing import Any, Optional
from untypy.error import UntypyTypeError
from untypy.interfaces import TypeChecker, CreationContext, TypeCheckerFactory, ExecutionContext
class DummyDelayedType:
"""
This class is used for raising delayed type checking errors.
"""
... | StarcoderdataPython |
1699189 | # sway
from __future__ import print_function, division
import zipfile,re,traceback,random,sys
sys.dont_write_bytecode = True
##################################################
# test engine
class ok:
tries = fails = 0 # tracks the record so far
def score(i):
t,f= ok.tries, ok.fails
return "# TRIES= %... | StarcoderdataPython |
96500 | from string import ascii_letters, digits
from random import choice
CARACTERES = ascii_letters + digits
class Clave:
def __init__(self: object, longitud: int = 12) -> None:
"""..."""
self.__clave = self.__crear_clave(longitud)
def __crear_clave(self: object, longitud: int) -> str:
""... | StarcoderdataPython |
1757715 | """
BMI203: Biocomputing algorithms Winter 2022
Assignment 6: Logistic regression
"""
from regression import (logreg, utils)
__version__ = '0.1.0' | StarcoderdataPython |
96954 | from .base import BaseDevice
import random
default_protocol_config = {
"protocol_config": [{
"nbns": {
"frequency": random.randint(30, 60)
},
"nbdgm": {
"frequency": random.randint(30, 60),
"type": "browser",
"cmd": "announcement",
... | StarcoderdataPython |
1673546 | import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import math
import numpy as np
try:
from numpy.random import Generator as Generator
except ImportError:
class Generator(): # type: ignore[no-redef]
pass
def _lazywhere(cond, ... | StarcoderdataPython |
10979 | from keras.optimizers import RMSprop
from keras.layers import Input, Embedding, Dense, LSTM, Bidirectional, GRU
from keras.layers import concatenate, Reshape, SpatialDropout1D
from keras.models import Model
from keras import backend as K
from .AttentionWeightedAverage import AttentionWeightedAverage
def textgenrnn_mo... | StarcoderdataPython |
129335 | #!/usr/bin/env python3
# load needed modules
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten, Dropout, GRU , BatchNormalization
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
import pandas as pd
imp... | StarcoderdataPython |
128321 | <reponame>WojciechMula/parsing-int-series<gh_stars>10-100
from generator import Generator
from table import Table
if __name__ == '__main__':
gen = Generator()
freq = {}
for bi in gen.run():
k = bi.total_skip
freq[k] = freq.get(k, 0) + 1
table = Table()
table.add_header(["bytes pr... | StarcoderdataPython |
1752716 | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import textwrap
from dataclasses import dataclass
from typing import Generic, Optional, Sequence, Type, get_type_hints
from pants.engine.console import Console
from pants.engine.goal impo... | StarcoderdataPython |
192020 | # coding=utf-8
# Copyright 2022 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 |
113613 | '''
Created on Dec 11, 2015
@author: <NAME>
'''
if __name__ == '__main__': pass
import socket
import netaddr
import nmap
import sys
wdtvlive = '192.168.1.64' ## port 80, 139, 443 open
uraniaAddy = '192.168.1.73'
network = "192.168.1.250/24"
deliaAddy = '192.168.1.65'
userPC = '192.168.1.68'
######################... | StarcoderdataPython |
1754986 | <filename>gtsfm/utils/graph.py
"""Utilities for performing graph operations.
Authors: <NAME>
"""
from typing import List, Tuple
import networkx as nx
def get_nodes_in_largest_connected_component(edges: List[Tuple[int, int]]) -> List[int]:
"""Finds the nodes in the largest connected component of the bidirectiona... | StarcoderdataPython |
1712236 | import datetime as dt
import dateutil.parser
import itertools
import types
import uuid
from .utils import tzadd, tznow
import logging
logger = logging.getLogger(__name__)
from collections import Iterator
class Field:
"""
Base class for all field types. it tries to hold all the functionality
so derived ... | StarcoderdataPython |
3237249 | <filename>app/test/migrations/0002_auto_20210917_0834.py
# Generated by Django 3.2.6 on 2021-09-17 08:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('test', '0001_initial'),
]
operations = [
migrations.AddField(
model_nam... | StarcoderdataPython |
131715 | <filename>wefe/word_embedding_model.py
from gensim.models.keyedvectors import BaseKeyedVectors
class WordEmbeddingModel:
"""A container for Word Embedding pre-trained models.
It can hold gensim's KeyedVectors or gensim's api loaded models.
It includes the name of the model and some vocab prefix if needed... | StarcoderdataPython |
3212389 | #!/cluster/home2/mglerner/anaconda3/bin/python
#!/usr/bin/env python
import sys,os,glob
if __name__ == '__main__':
from pypat import tool_utils
import glob
from optparse import OptionParser
usage = tool_utils.usage + """
Please also make sure that the imagemagick utility convert
is installed and in ... | StarcoderdataPython |
3389492 | import os
import sys
from .get_search_path import get_search_path
from .run_all import run_all
search_path = get_search_path()
if not os.path.exists(search_path):
sys.stderr.write('Failed to locate "%s"\n' % search_path)
exit(1)
exit(run_all(search_path))
| StarcoderdataPython |
1767810 | <gh_stars>0
class AppTestMagic:
spaceconfig = dict(usemodules=['__pypy__'])
def test_save_module_content_for_future_reload(self):
import sys, __pypy__, imp
d = sys.dont_write_bytecode
sys.dont_write_bytecode = "hello world"
__pypy__.save_module_content_for_future_reload(sys)
... | StarcoderdataPython |
1673091 | <filename>notion_extensions/base/props/block/quote.py
from typing import Dict, Optional, Union
from .block import Block
from .children import Children
from ..common import Text, RichText
__all__ = [
"Quote",
]
class Quote(Block):
"""
Quote
Quote property values of block
Attributes
---------... | StarcoderdataPython |
3332993 | <reponame>RajdeepJuneja/ga-learner-dsmp-repo<gh_stars>0
# --------------
#Code starts here
def read_file(file_path_1):
file1 = open(file_path_1,'r')
sentence_1 = file1.readline()
file1.close()
return sentence_1
message_1 = read_file(file_path_1)
print(message_1)
def read_file(file_path_2):
... | StarcoderdataPython |
1619922 | <reponame>jhh67/chapel
# RUN: %{python} %s %{inputs}/unparsed-requirements
import sys
from lit.Test import Result, Test, TestSuite
from lit.TestRunner import parseIntegratedTestScript
from lit.TestingConfig import TestingConfig
config = TestingConfig(None, "config", [".txt"], None, [], [], False, sys.argv[1], sys.arg... | StarcoderdataPython |
1623171 | """
This is the ViewCLI class, used to interface this program via
the console (e.g. terminal, commandline, or shell).
This class can be used to demonstrate the functionality of the ViewBraille
class on a computer via the shell.
Despite being referred to as a 'view' it also includes support for input.
"""
class ViewC... | StarcoderdataPython |
1627499 | from shiftschema.validators.abstract_validator import AbstractValidator
from shiftschema.result import Error
class Required(AbstractValidator):
"""
Required validator
Checks that value was provided. Can operate on strings or entities with an
option to allow False to be a valid value.
"""
valu... | StarcoderdataPython |
40805 | <gh_stars>0
### This sample will show how programmatically create and post an annotation into document. How to delete the annotation
# Import of classes from libraries
from pyramid.renderers import render_to_response
from groupdocs.ApiClient import ApiClient
from groupdocs.AntApi import AntApi
from groupdocs.S... | StarcoderdataPython |
3214166 | class TwoSum:
"""
Given an array of integers arr and an integer target,
return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution,
and you may not use the same element twice.
"""
def __init__(self, arr, k):
self.arr = arr
self.k = k
"... | StarcoderdataPython |
19962 | <filename>talos/distribute/distribute_run.py
import json
import threading
from .distribute_params import run_scan_with_split_params
from .distribute_utils import return_current_machine_id, ssh_connect, ssh_file_transfer, ssh_run
from .distribute_database import update_db
def run_central_machine(self, n_splits, run_ce... | StarcoderdataPython |
1640123 | import torch
import torch.nn as nn
import numpy as np
np.random.seed(0)
from model.generate_anchor import generate_anchors
from model.bbox_transform import clip_boxes
from model.ellipse_transform import ellipse_transform_inv, ellipse2box
from nms.cpu_nms import cpu_nms
from nms.gpu_nms import gpu_nms
def _filter_b... | StarcoderdataPython |
1677241 | <filename>Artifacts/Results/plotcopa.py<gh_stars>1-10
import os
import numpy as np
import matplotlib.pyplot as plt
import sys
from glob import glob
import pandas as pd
import seaborn as sns
import math
import matplotlib.gridspec as gridspec
from matplotlib.patches import Ellipse
plt.rcParams['text.latex.preamble']=[r'... | StarcoderdataPython |
155921 | <filename>src/slave/slave.py
import zmq as mySocket
import sys
import threading
import json
import time
import base64
import zlib
from json_to_txt import make as json_txt
from save_file import save_txt
from mapper import mapper
from sorting import sorting
from reducer import reducer
def descompacta(text):
return ... | StarcoderdataPython |
1663547 | """ A list of (Google) search terms for a variant """
from collections import defaultdict
from typing import Tuple, List
from pyhgvs import HGVSName, InvalidHGVSName
def _get_gene_and_terms(vta, c_hgvs=True, dbsnp=True) -> Tuple[str, List]:
from annotation.models import VariantTranscriptAnnotation
if vta.ge... | StarcoderdataPython |
4813735 | """Idea: self-organization, two pathways:
- horizontal
- vertical (stacked, deep, onion, ...)
Moved to and developed in smp_growth project
"""
import time, sys, argparse
import numpy as np
import matplotlib.pyplot as plt
types = ["RBF", "tanh", "local_linear_reg_rls", "randomBF", "res", "kerasmodel"]
class unitID... | StarcoderdataPython |
4813439 | <gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
FASL_GRAPH_DEF_TYPE = 1
FASL_GRAPH_REF_TYPE = 2
FASL_FALSE_TYPE = 3
FASL_TRUE_TYPE = 4
FASL_NULL_TYPE = 5
FASL_VOID_TYPE = 6
FASL_EOF_TYPE = 7
FASL_INTEGER_TYPE = 8
FASL_FLONUM_TYPE = 9
FASL_SINGLE_FLONUM_TYPE = 10
FASL_RATIONAL_TYPE = 11
FASL_COMPLEX_TYPE =... | StarcoderdataPython |
1723788 | <reponame>Saruni0305/oop-work-2
import requests
import json
import re
import hashlib
from django.conf import settings
MAILCHIMP_API_KEY = getattr(settings, 'MAILCHIMP_API_KEY', None)
if MAILCHIMP_API_KEY is None:
raise NotImplementedError("MAILCHIMP_API_KEY must be set in the settings")
MAILCHIMP_DATA_CENTER = ... | StarcoderdataPython |
3306082 | <filename>fs_image/compiler/tests/test_image_layer.py
#!/usr/bin/env python3
import os
import sys
import unittest
from contextlib import contextmanager
from artifacts_dir import ensure_per_repo_artifacts_dir_exists
from btrfs_diff.tests.render_subvols import render_sendstream
from btrfs_diff.tests.demo_sendstreams_ex... | StarcoderdataPython |
3254821 | """============================================================================
Palyer input
Register user input according to key binding
============================================================================"""
import pygame
from pygame import *
MOUSE_LEFT = 1
MOUSE_WHEEL = 2
MOUSE_RIGHT = 3
key_bin... | StarcoderdataPython |
12670 | <gh_stars>0
"""Implementation of the unary-operator-replacement operator.
"""
import ast
from .operator import Operator
from ..util import build_mutations
# None indicates we want to delete the operator
OPERATORS = (ast.UAdd, ast.USub, ast.Invert, ast.Not, None)
def _to_ops(from_op):
"""
The sequence o... | StarcoderdataPython |
1633220 | <reponame>charutomo/SOC
import math
class Vector:
"""Base 2D Object.
Attributes
----------
x: float
The x coordinate
y: float
The y coordinate
"""
def __init__(self, _x, _y):
"""Constructor
Parameters
----------
... | StarcoderdataPython |
3356973 | import boto3
import glob
import gzip
import os
s3 = boto3.client('s3')
TPCH_TABLE_NAMES = ['customer', 'lineitem', 'nation',
'orders', 'part', 'partsupp', 'region', 'supplier']
def check_region(region):
if os.environ['AWS_REGION'] != region:
raise Exception(
f"Your stack ... | StarcoderdataPython |
3342470 | # sorting algorithm -> bubblesort
# About bubblesort: Best case O(n), Average O(n2), Worst case O(n2)
# @author unobatbayar
# Thanks to HackerRank's bubblesort tutorial
title = 'Welcome to Bubblesort Algorithm!'
print(title + '\n' + 'Enter unsorted data set: ')
user_input = input()
array = user_input.split()
def bu... | StarcoderdataPython |
4838718 | <gh_stars>0
import unittest
import torch
from torch.utils.data import DataLoader
from datasets.utils import set_progress_bar_enabled
import warnings
from trigger_attack.trigger import Trigger
from trigger_attack.preprocessing import ner as nerPreprocess
from trigger_attack.preprocessing import sc as scPreprocess
from... | StarcoderdataPython |
3350912 | <filename>ANSA_AUTOMESHER/GenerateGBMR.py
import ansa
import os
from ansa import *
@session.defbutton("QFSAE_TOOLS","GenerateGBMR")
def GenerateGBMR():
#Determine the file name from the database name as well as its path
current_model = ansa.base.DataBaseName()
model_path = current_model.split("/")
file_base = mod... | StarcoderdataPython |
3376281 | # Copyright (c) IBM Corporation 2020
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
import re
import sys
from ansible_doc_extractor.cli import main
from ansible.utils.collection_loader import AnsibleCollectionLoader
if __name__ == '__main__':
# allow doc-extractor to import code fro... | StarcoderdataPython |
3375691 | <filename>gui.py
import tkinter as tk
import threading
from tkinter import scrolledtext
from tkinter import messagebox
ENCODING = 'utf-8'
class GUI(threading.Thread):
def __init__(self, client):
super().__init__(daemon=False, target=self.run)
self.font = ('Helvetica', 13)
self.client = cl... | StarcoderdataPython |
3205063 | from django.contrib import admin
from .models import Prpdutos,Cliente
class Produtoadmin(admin.ModelAdmin):
list_display = ('nome','preco','estoque')
admin.site.register(Prpdutos,Produtoadmin)
admin.site.register(Cliente)
| StarcoderdataPython |
3278389 | <filename>py/py_0190_maximising_a_weighted_product.py<gh_stars>0
# Solution of;
# Project Euler Problem 190: Maximising a weighted product
# https://projecteuler.net/problem=190
#
# Let Sm = (x1, x2, . . . , xm) be the m-tuple of positive real numbers with
# x1 + x2 + . . . + xm = m for which Pm = x1 * x22 * . . . * ... | StarcoderdataPython |
3324066 | <reponame>viniciusd/DCO1008---Digital-Signal-Processing<gh_stars>0
import numpy as np
from scipy import fftpack
class Fft:
def __init__(self, x, *, sample_rate=None, padded=False):
if sample_rate is None:
raise ValueError('You must determine the sample rate')
fs = sample_rate
... | StarcoderdataPython |
1779150 | <filename>api/models/gcd/series.py
from django.db import models
from api.models.gcd.country import GCDCountry
from api.models.gcd.language import GCDLanguage
from api.models.gcd.image import GCDImage
from api.models.gcd.publisher import GCDPublisher
class GCDSeries(models.Model):
class Meta:
app_label = '... | StarcoderdataPython |
1634277 | from pathlib import Path
import argparse
import json
import glob
import sys
from matplotlib import pyplot as plt
import numpy as np
def roc_graphs(fprs, tprs, names, aucs, savename, minx=0.85):
colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k']
plt.figure() # figsize=(10, 10)
ax = plt.axes(xscale='log', xli... | StarcoderdataPython |
3907 | # 2. Repeat Strings
# Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string.
strings = input().split()
output_string = ""
for string in strings:
N = len(string)
output_string += string * N
print(output_string)
| StarcoderdataPython |
89903 | import torch as th
import math
import numpy as np
from video_loader import VideoLoader
from torch.utils.data import DataLoader
import argparse
from preprocessing import Preprocessing
from random_sequence_shuffler import RandomSequenceSampler
import torch.nn.functional as F
from tqdm import tqdm
import os
import clip
... | StarcoderdataPython |
35396 | <filename>formulario/urls.py
from django.conf.urls import include, url
from formulario import views
urlpatterns = [
url(r'^form/registro/(?P<pk>\d+)/$', views.RegistroSupraForm.as_view(), name='form_registro'),
url(r'^form/registro/create/$', views.RegistroCreateSupraForm.as_view(), name='form_crear_registro'),
url... | StarcoderdataPython |
1659994 | """
Balanced strings are those who have equal quantity of 'L' and 'R' characters.
Given a balanced string s split it in the maximum amount of balanced strings.
Return the maximum amount of splitted balanced strings.
Example:
Input: s = "RLRRLLRLRL"
Output: 4
Explanation: s can be split into... | StarcoderdataPython |
4836259 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
bonds = {
'C-C': 1,
'C-H': 5,
}
linear = False
externalSymmetry = 1
spinMultiplicity = 2
opticalIsomers = 1
energy = {
'CBS-QB3': Log('ethyl_cbsqb3.log'),
'Klip_2': -78.98344186,
}
geometry = Log('ethyl_b3lyp.log')
frequencies = Log('eth... | StarcoderdataPython |
4829449 | """
The query counts as a “hit” every time that finds a page with a particular term from a lexicon
and it groups the results by books.
"""
from operator import add
from defoe import query_utils
from defoe.nls.query_utils import preprocess_clean_page, clean_page_as_string
from defoe.nls.query_utils import get_sentence... | StarcoderdataPython |
4809287 | <gh_stars>1-10
#!/usr/bin/env python
from __future__ import division
import rospy
from visualization_msgs.msg import Marker
from utils.math_utils import int_or_float
from utils.markers import car_marker
VTD_CAR_X = 4.22100019455 # parameters corresponding to VTD simulated car
VTD_CAR_Y = 1.76199996471
VTD_CAR_dX = ... | StarcoderdataPython |
1661976 | <gh_stars>0
"""module for parse content"""
import collections
File = collections.namedtuple("File", "name path alg hash")
def parse(content, path_to_files):
"""
params:
content - list of string "name algorithm given_hash"
path_to_files - path to dir with files
return:
list of na... | StarcoderdataPython |
4834621 | import numpy as np
from .base import ClassifierModule
from .bert import BERTClassifier
from ..model.bert import BERTConfig
from ..model.fastbert import FastBERTClsDistillor, convert_ignore_cls
from ..token import WordPieceTokenizer
from ..third import tf
from .. import com
class FastBERTClassifier(BERTClassifier, Cl... | StarcoderdataPython |
1701782 | from typing import (
Dict,
Tuple,
)
import logging
import toposort
from haoda import ir, util
from haoda.ir.arithmetic import base
_logger = logging.getLogger().getChild(__name__)
GRAMMAR = r'''
SodaProgram:
(
('border' ':' border=BorderStrategies)?
('burst' 'width' ':' burst_width=INT)
('cluster' ':... | StarcoderdataPython |
3258683 | <reponame>eng-tools/eqdes
import numpy as np
from sfsimodels import loader as ml
from sfsimodels import output as mo
from eqdes import models as em
import sfsimodels as sm
from eqdes import dbd_tools as dt
from eqdes import nonlinear_foundation as nf
from eqdes import moment_equilibrium
import geofound as gf
from eqd... | StarcoderdataPython |
188048 | <reponame>Nexusoft/LLL-OS<gh_stars>1-10
#
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
#
# SPDX-License-Identifier: GPL-2.0-only
#
''' generate a yaml file with memory region info from the device tree '''
import argparse
import yaml
from hardware import config, fdt
from hardware.utils import memory, rule
d... | StarcoderdataPython |
77060 | <filename>umake/test.py<gh_stars>10-100
#!/usr/bin/env python
#coding: utf-8
from umake import CMake
#cmake = CMake('3.15', 'hello')
#cmake.add_library('hello', ['src/hello.h', 'src/hello.cpp'])
#cmake.add_executable('demo', ['src/main.cpp'])
#cmake.target_link_libraries('demo', ['hello'])
cmake = CMake('3.15', 'h... | StarcoderdataPython |
3219178 | import utils
import pytest
import time
from deepdiff import DeepDiff
@pytest.mark.sanity
def test_single_interface_connected_multiple_interfaces():
"""
Deploy single otg duplicate interfaces kne topology,
- namespace - 1: ixia-c
Validate,
- kne_cli error
- total pods count - 0
- total servi... | StarcoderdataPython |
1748823 | <gh_stars>0
'''
* @Author: csy
* @Date: 2019-04-28 13:56:20
* @Last Modified by: csy
* @Last Modified time: 2019-04-28 13:56:20
'''
for value in range(1, 5):
print(value)
numbers = list(range(1, 6))
print(numbers)
| StarcoderdataPython |
37016 | from datetime import datetime
class Price:
date: datetime = datetime(1, 1, 1)
currency: str = 'BRL'
symbol: str = ''
current: float = 0
open: float = 0
close: float = 0
low: float = 0
high: float = 0
volume: float = 0
interval: str = ''
def __init__(self, **kwargs):
... | StarcoderdataPython |
103684 | #!/usr/bin/env python3
import os
import time
import subprocess
import random
import inquirer
import stat
import wget
from libsw import php, nginx, user, bind, cert, db, settings, input_util
from getpass import getpass
from mysql import connector
from pwd import getpwnam
def list_installations():
"""
List all ... | StarcoderdataPython |
3382685 | <reponame>priyamshah112/Project-Descripton-Blog
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from parler.utils.context import switch_language
from aldryn_categories.models import Category
from aldryn_categori... | StarcoderdataPython |
109878 | <reponame>sheagk/leetcode_solutions
## https://leetcode.com/problems/find-all-duplicates-in-an-array/
## pretty simple solution -- use a set to keep track of the numbers
## that have already appeared (because lookup time is O(1) given
## the implementation in python via a hash table). Gives me an O(N)
## runtime
##... | StarcoderdataPython |
1722670 | <reponame>veot/ifcbdb
# Generated by Django 2.1.7 on 2019-05-28 06:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0018_auto_20190508_1659'),
]
operations = [
migrations.AlterField(
model_name='bin',
... | StarcoderdataPython |
27709 | <gh_stars>0
# Generated by Django 3.2.9 on 2021-12-13 21:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('awards', '0004_auto_20211213_1253'),
]
operations = [
migrations.RenameField(
model_name='rating',
old_name='avg... | StarcoderdataPython |
1700654 | __VERSION__ = "0.17.1"
| StarcoderdataPython |
1657701 | import requests
import json
class runner:
def __init__(self):
self._apiUrl = 'https://api.jdoodle.com/v1/execute'
self._apiID = 'your id here' # change it to your api id
self._apiSecret = 'your secret here' # change it to your api secret
pass
def sendCode(self, source_code... | StarcoderdataPython |
3230291 | <reponame>amjadmajid/rosbook<filename>chessbot/r2_chess_pgn.py
#!/usr/bin/env python
import sys, rospy, tf, moveit_commander, random
from geometry_msgs.msg import Pose, Point, Quaternion
import pgn
class R2ChessboardPGN:
def __init__(self):
self.left_arm = moveit_commander.MoveGroupCommander("left_arm")
self... | StarcoderdataPython |
193483 | <reponame>jayatsandia/svp_energy_lab
"""
Copyright (c) 2017, Sandia National Labs and SunSpec Alliance
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the abov... | StarcoderdataPython |
1607481 | <filename>lib/tpn/invariant.py<gh_stars>1-10
#===============================================================================
# Imports
#===============================================================================
import os
import re
import inspect
import datetime
import linecache
import itertools
from .util import... | StarcoderdataPython |
1665010 | <reponame>ngarneau/awd-lstm-lm
import logging
import argparse
import time
import math
import os
import hashlib
import numpy as np
import torch
import torch.nn as nn
import data
from data import SentenceLoader
import model as m
from utils import batchify, get_batch, repackage_hidden
from splitcross import SplitCrossE... | StarcoderdataPython |
1786006 | from django.apps import AppConfig
class AIModelConfig(AppConfig):
name = 'aimodel'
verbose_name = "II-20: AI Model config"
| StarcoderdataPython |
3305572 | #!/usr/bin/env python
# -*- coding: utf-8 -*--
# Copyright (c) 2021 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
"""
The module that represents an IpAddressV6 feature type.
Classes:
IpAddressV6
The IpAddressV6 featu... | StarcoderdataPython |
4839110 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import math
import sys
import argparse
import rospy
import time
import tf2_ros
from lxml import etree
from collections import deque
import numpy
import yaml
import underworlds
from std_msgs.msg import String
from underworlds.types import Entity, Mesh, Camera, MESH, Situati... | StarcoderdataPython |
3323063 | <reponame>metalibm/metalibm
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2019 K... | StarcoderdataPython |
23684 | <gh_stars>1-10
# JSON engine 21 9 16
# database
# eng.json
# engine
# eng.py
import os
import json
path = os.getcwd() + '\\json_engine_database\\'
path_string = ''
def set_path(string):
global path
path = os.getcwd() + string
def dictionary_kv(dictionary, key, value):
dictionary[key] = va... | StarcoderdataPython |
3351906 | import spotipy
from settings import settings
import spotipy.util as util
from time import sleep
class Spotify:
def __init__(self):
self.spotify = spotipy.Spotify()
self.tokens = {}
self.username = settings['username']
def get_spotify(self, scope):
s = self.tokens.get(scope)
... | StarcoderdataPython |
3397104 | <reponame>AccSrd/multimodal-Parkinson-data-processing<filename>Scripts/prep2seg.py
"""
************************************************************************************************
*********************** Preprocessed --> Segmented ***********************************
***************************************... | StarcoderdataPython |
1767694 | # -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2019-12-28 13:13:28
# @Last Modified by: <NAME>
# @Last Modified time: 2019-12-28 13:13:28
| StarcoderdataPython |
3266238 | BUILDING_LABEL = 3
OTHER_LABEL = 0
IRRELEVANT_LABELS_ADE = [27, 62, 91, 114, 129]
MAPPING_DICT_ADE = {
1: [10, 14, 17, 30, 35, 47, 69, 95],
2: [5, 18, 67, 73],
3: [1, 2, 4, 6, 26, 49, 85],
4: [87, 89, 115],
5: [33],
6: [3],
7: [7, 55],
8: [12, 53, 92],
9: [9, 15, 19],
10: [21, 8... | StarcoderdataPython |
187298 | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file which has required functions to embed the charts in html page
from ..fusioncharts import FusionCharts
# Loading Data from a Static JSON String
# It is a example to show a mscombi 2d chart where data is passed... | StarcoderdataPython |
183260 | <reponame>M0Rf30/mopidy-cd
from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.5.1'
class Extension(ext.Extension):
dist_name = 'Mopidy-Cd'
ext_name = 'cd'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.d... | StarcoderdataPython |
1716992 | from django import urls
from django.db import models
from django.utils import html
from django.utils.translation import ugettext_lazy as _
from djfw.wysibb.templatetags import bbcodes
from tulius.forum.comments import models as comment_models
from tulius.gameforum.threads import models as thread_models
from tulius.sto... | StarcoderdataPython |
3296580 | # encoding: utf-8
"""
"""
__author__ = '<NAME>'
__date__ = '13 Feb 2020'
__copyright__ = 'Copyright 2018 United Kingdom Research and Innovation'
__license__ = 'BSD - see LICENSE file in top-level package directory'
__contact__ = '<EMAIL>'
from collections import namedtuple
def get_file_subset(path_gen, max_number):
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.