id stringlengths 2 8 | text stringlengths 16 264k | dataset_id stringclasses 1
value |
|---|---|---|
1608600 | # -*- coding: utf-8 -*-
#############################################################################
# #
# <NAME> GMBH #
# STUTTGART ... | StarcoderdataPython |
3558498 |
import sys
from threading import Thread
sys.path.append('/Users/rodrigobresan/Documents/dev/github/anti_spoofing/spoopy/spoopy')
import os
import cv2
from tools.file_utils import file_helper
def extract_rbd_saliency_folder(folder_path, output_root):
frames = file_helper.get_frames_from_folder(folder_path)
... | StarcoderdataPython |
3256644 | """Module containing the tests for the default scenario."""
# Standard Python Libraries
import os
# Third-Party Libraries
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
@pytest.mark.par... | StarcoderdataPython |
1697971 | <reponame>seanandrews/DSHARP_CPDs
import os, sys, time
import numpy as np
from gen_mdl import gen_mdl
names = ['dx5_incl2', 'dx5_PA5', 'incl2_PA5', 'incl2_PA5_dx5',
'zr3_dx5', 'zr3_dy5', 'zr3_incl2', 'zr3_PA5']
pars = [ [37., 110., 150., 0.0, 1., 15., 0.5, 0.005, 0.000], # dx5mas/i+2
[35., 115., 15... | StarcoderdataPython |
53469 | <reponame>voreille/plc_seg<filename>src/models/layers.py
import tensorflow as tf
class ResidualLayer2D(tf.keras.layers.Layer):
def __init__(self, *args, activation='relu', **kwargs):
super().__init__()
self.filters = args[0]
self.conv = tf.keras.layers.Conv2D(*args,
... | StarcoderdataPython |
6479096 | '''
python中 内置函数 __init__方法 和 __new__方法 区别
'''
class display(object):
def __init__(self, *args, **kwargs):
print("init")
def __new__(cls, *args, **kwargs):
print("new")
a=display()
| StarcoderdataPython |
6501619 | ##
##
try:
import http.client as httpcl
except ImportError:
import httplib as httpcl
from dynamicserialize import DynamicSerializationManager
from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse
from dynamicserialize.dstypes.com.raytheon.uf.common.serializ... | StarcoderdataPython |
334 | <filename>lib/galaxy/tool_util/deps/container_resolvers/__init__.py<gh_stars>1-10
"""The module defines the abstract interface for resolving container images for tool execution."""
from abc import (
ABCMeta,
abstractmethod,
abstractproperty,
)
import six
from galaxy.util.dictifiable import Dictifiable
@... | StarcoderdataPython |
3309684 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-08-28 23:35
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('rememberTheCheese', '0014_aut... | StarcoderdataPython |
11218088 | from text_parser import Scam_parser
from model import Gated_Transformer_XL
import config_text as config
from utils import shuffle_ragged_2d, inputs_to_labels
import numpy as np
import tensorflow as tf
import argparse
import os
import pathlib
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser()
... | StarcoderdataPython |
6630199 | <filename>akshare/pro/client.py<gh_stars>1000+
# -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2019/11/10 22:52
Desc: 数据接口源代码
"""
from functools import partial
from urllib import parse
import pandas as pd
import requests
class DataApi:
__token = ""
__http_url = "https://api.qhkch.com"
def __init... | StarcoderdataPython |
6592723 | import pyqt_designer_plugin_entry_points
print("(pyqt_designer_plugin_entry_points hook)")
globals().update(**pyqt_designer_plugin_entry_points.find_widgets())
| StarcoderdataPython |
5109606 | import warnings
warnings.simplefilter(action="ignore", category=RuntimeWarning)
warnings.simplefilter(action="ignore", category=PendingDeprecationWarning)
import pytest
import os
from tempfile import NamedTemporaryFile, mkdtemp
from schicexplorer import scHicAdjustMatrix
ROOT = os.path.join(os.path.dirname(os.path.abs... | StarcoderdataPython |
3333153 | <reponame>etinaude/python-sorting-algorithms<filename>sort.py
'''
each algorithm is in a function which takes only an unsorted array as a parameter returns the sorted array
there are notes before each algorithm explaining it
n = number of elements to sort
d = number of digits in the largest element
... | StarcoderdataPython |
1822046 | <filename>turbopotato/media.py
from collections import namedtuple
from copy import copy
import logging
import os
from pathlib import Path, PurePosixPath
from typing import List, Union
import PyInquirer
from turbopotato.arguments import args
from turbopotato.exceptions import NoMediaFiles
from turbopotato.media_defs i... | StarcoderdataPython |
225333 | <reponame>certara-ShengnanHuang/machine-learning
import random
from typing import Tuple
__all__ = ['train_test_split_file']
def train_test_split_file(input_path: str,
output_path_train: str,
output_path_test: str,
test_size: float=0.1,
... | StarcoderdataPython |
234770 | <gh_stars>0
from django.shortcuts import render
from django.http import HttpResponse
from apps.producto.models import producto
from apps.producto.forms import ProductoForm
from apps.carrito.forms import agregarCarritoForm
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorato... | StarcoderdataPython |
1998741 | <filename>datadict/datadict.py
import pandas as pd
import numpy as np
import warnings
import os
import functools
import pickle
from os import path
from pandas.api.types import is_numeric_dtype
from typing import Dict
class DataDict:
"""
This class provides functionality for mapping the columns of different da... | StarcoderdataPython |
270455 | """
Test SBTarget APIs.
"""
import unittest2
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestNameLookup(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
@expectedFailureAll(oslis... | StarcoderdataPython |
1651951 | #!/usr/bin/env python
from setuptools import find_packages, setup
VERSION = "0.0.1"
setup(
name="gnome-randomwall",
version=VERSION,
author="<NAME>",
author_email="<EMAIL>",
url="https://github.com/gnome-randomwall",
description="Random wallpaper selector for GNOME desktop",
license="MIT",... | StarcoderdataPython |
5066905 | <filename>examples/Sample_code/error_handling.py<gh_stars>0
import pydp as dp
# Sample code to display error handling
x = dp.algorithms.laplacian.Max(1)
try:
print(x.quick_result([2, 8]))
except RuntimeError as e:
print("e")
except SystemError:
print("system error")
else:
print("i give up")
| StarcoderdataPython |
11369338 | <reponame>neosavvyinc/mixpanel-celery
import httplib
import urllib
import base64
import urlparse
import logging
import socket
from django.utils import simplejson
from celery.task import Task
from celery.registry import tasks
from mixpanel.conf import settings as mp_settings
class EventTracker(Task):
"""
Tas... | StarcoderdataPython |
391422 | __copyright__ = "Copyright (C) 2012 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | StarcoderdataPython |
4955080 | """
Test ChatterBot's statement comparison algorithms.
"""
from unittest import TestCase
from app.chatterbot.conversation import Statement
from app.chatterbot import comparisons
from app.chatterbot import languages, tagging
# set language
LANGUAGE = languages.CHI
class LevenshteinDistanceTestCase(TestCase):
def... | StarcoderdataPython |
3579947 | """Map views with routes."""
from .default import (
home_view,
welcome_view,
sundays_view,
youth_kids_view,
go_deeper_view,
bible_studies_view,
life_groups_view,
military_view,
bobs_view,
worship_view,
hebrews_view,
message_view,
children_view,
values_view,
c... | StarcoderdataPython |
9671568 | <gh_stars>0
# coding:UTF-8
QINIU_HOST = ""
QINIU_KEY = ""
QINIU_TOKEN = ""
QINIU_BUCKET = ""
CACHE_PREFIX = "glue" | StarcoderdataPython |
1999053 | <filename>src/config/device-manager/device_manager/plugins/ansible/job_handler.py<gh_stars>0
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of job api handler code
"""
import gevent
import json
import random
from enum import Enum
from vnc_api.vnc_api import V... | StarcoderdataPython |
3369577 | __all__ = ['ImageAutoEncoders', 'ExprAutoEncoders', 'JointLatentGenerator', 'Baseline', 'Translators']
from .ImageAutoEncoders import AAEImg, ImgVAE
from .Translators import DomainTranslator
from .ExprAutoEncoders import (AE, VAE, AAE, SupervisedAAE,
ClassDiscriminator, ClassDiscriminatorBig, Discriminator,... | StarcoderdataPython |
11307082 | """Support running bcbio-nextgen inside of isolated docker containers.
"""
| StarcoderdataPython |
9747251 | <gh_stars>0
from . import command_line
exit(command_line())
| StarcoderdataPython |
6429919 | <reponame>gruber-sciencelab/SMEAGOL
from smeagol.matrices import *
import os
import pandas as pd
from smeagol.utils import _equals
import pytest
script_dir = os.path.dirname(__file__)
rel_path = "data"
data_path = os.path.join(script_dir, rel_path)
def test_check_ppm():
probs = np.array([[0, 0, 0, 1], [.5, .5, ... | StarcoderdataPython |
1784775 | import importlib
import pytest
module = importlib.import_module("19_an_elephant_named_joseph")
josephus = module.josephus
round_game = module.round_game
@pytest.mark.parametrize(
"elves, winner",
[
(1, 1),
(2, 1),
(3, 3),
(4, 1),
(5, 3),
(6, 5),
(7, 7)... | StarcoderdataPython |
9609182 | <reponame>AleksNeStu/projects
# 🚨 Don't change the code below 👇
student_scores = input("Input a list of student scores ").split()
for n in range(0, len(student_scores)):
student_scores[n] = int(student_scores[n])
print(student_scores)
# 🚨 Don't change the code above 👆
print('The highest score in the class is: {... | StarcoderdataPython |
3528978 | <filename>cyder/cydhcp/interface/dynamic_intr/forms.py<gh_stars>1-10
from django import forms
from cyder.cydhcp.interface.dynamic_intr.models import (DynamicInterface,
DynamicIntrKeyValue)
class DynamicInterfaceForm(forms.ModelForm):
class Meta:
mod... | StarcoderdataPython |
6512229 | # coding:utf-8
from pecan import conf # noqa
def init_model():
"""
This is a stub method which is called at application startup time.
If you need to bind to a parsed database configuration, set up tables or
ORM classes, or perform any database initialization, this is the
recommended place to do ... | StarcoderdataPython |
9674687 | from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-long-enumeration-1-NS"
class NistschemaSvIvAtomicLongEnumeration1Type(Enum):
VALUE_67417897408 = 67417897408
VALUE_445463702 = 445463702
VALUE_11686316 = 11686316
VALUE_... | StarcoderdataPython |
3553687 | """Update module."""
from dataclasses import dataclass
from typing import Tuple
import click
from . import git, github, poetry
program_name = "poetry-up"
@dataclass
class Options:
"""Options for the update operation."""
latest: bool
install: bool
commit: bool
push: bool
merge_request: boo... | StarcoderdataPython |
4986882 | <gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
class Lorenz_equations:
'''
Lorenz equations class
'''
def __init__(self, prandtl_number, rayleigh_number, beta, delta_t):
self.sigma = prandtl_number
self.rho = rayleigh_number
self.beta = beta
sel... | StarcoderdataPython |
11261113 | <reponame>Alexhuszagh/XLDiscoverer
'''
Utils/skimage/measure
_____________________
Block_reduce functionality to rapdily interpolate large arrays.
:copyright: Copyright (C) 2011, the scikit-image team
:license: see licenses/skimage.txt for more details.
'''
# load modules
import numpy as np
from... | StarcoderdataPython |
6583650 | <filename>inductive_modules.py
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
import numpy as np
from scipy import sparse
from utilities import sparse_mx_to_torch_sparse_tensor, normalize
from metapath import query_path, query_path_indexed
def to_numpy(x):
... | StarcoderdataPython |
6512227 | <reponame>fransward/open-cultuur-data
from flask import Flask
from ocd_frontend.helpers import register_blueprints
def create_app_factory(package_name, package_path, settings_override=None):
"""Returns a :class:`Flask` application instance configured with
project-wide functionality.
:param package_name:... | StarcoderdataPython |
9610486 | <gh_stars>1-10
"""
ABC that defines the context manager behavior and stores base attributes
Not meant to be instantiated
"""
import logging
from abc import ABC
class HttpClientBase(ABC):
""" store base attributes for login and define context manager methods """
def __init__(self, user, password, token, logge... | StarcoderdataPython |
1938888 | #
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>
#
"""Implement local context attention."""
from math import sqrt
import torch
from torch.nn import Module, Dropout
from torch.nn import functional as F
from ..attention_registry import AttentionRegistry, Optional, In... | StarcoderdataPython |
3276209 | # -*- coding: utf-8 -*-
#
from bluepy import btle
import struct
import logging
_log = logging.getLogger(__name__)
_log.addHandler(logging.StreamHandler())
_log.setLevel(logging.INFO)
def _ZEI_UUID(short_uuid):
return 'c7e7%04X-c847-11e6-8175-8c89a55d403c' % (short_uuid)
class ZeiCharBase:
def __init__(se... | StarcoderdataPython |
4827525 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for updating target HTTP proxies."""
from googlecloudapis.compute.v1 import compute_v1_messages as messages
from googlecloudsdk.compute.lib import base_classes
class Update(base_classes.BaseAsyncMutator):
"""Update a target HTTP proxy."""
@staticmetho... | StarcoderdataPython |
126596 | <filename>example/app/forms.py
'''
Created on 24/05/2013
@author: luan
'''
from hstore_flattenfields.forms import HStoreModelForm
from models import Something
class SomethingForm(HStoreModelForm):
class Meta:
model = Something
| StarcoderdataPython |
146501 | <reponame>elminster-aom/homeworks
"""Validate that DB and Communication bus (Kafka) are defined with all
needed resources for our web-monitoring application
"""
import pytest
import traceback
from homeworks import config
from homeworks.communication_manager import Communication_manager
from homeworks.store_manager imp... | StarcoderdataPython |
1605433 | #!/usr/bin/env python
import sys, os, shutil
from pyps import *
# removing previous output
if os.path.isdir("loop_tiling.database"):
shutil.rmtree("loop_tiling.database", True)
ws = workspace("loop_tiling.c", name="loop_tiling",deleteOnClose=True)
ws.props.ABORT_ON_USER_ERROR = True
fct = ws.fun.main
# try a ... | StarcoderdataPython |
9721276 | <gh_stars>1000+
"""
States Directory
"""
| StarcoderdataPython |
8001340 | from typing import TextIO, Union, Optional, Callable, Dict, Type
from hbreader import FileInfo, hbread
from biolinkml.utils.yamlutils import YAMLRoot
def load_source(source: Union[str, dict, TextIO],
loader: Callable[[Union[str, Dict], FileInfo], Optional[Dict]],
target_class: Type[Y... | StarcoderdataPython |
3295994 | <filename>WebSearchableEquipmentDatabase/equipment/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('equipment/', views.data_table, name="equipment"),
path('filter/', views.filter_data, name="filter_data"),
path('uploadcsv/', views.upload_csv, name='uploadCSV'),
path('testi... | StarcoderdataPython |
4894061 | # _*_ ecoding: utf-8 _*_
| StarcoderdataPython |
11378686 | '''
Compare the outputs from the pure python to the pure c++ to ensure that they
are sane and both are implemented correctly.
The pure python is so that we can use pypy to see if it is faster with pyEvolve,
the c++ is much quicker than all implementations in python.
'''
import automata as pa
import pyAutomata as pb... | StarcoderdataPython |
5180891 | """Register the models for the admin."""
from django.contrib import admin
from .models import ImagerProfile
# Register your models here.
admin.site.register(ImagerProfile)
| StarcoderdataPython |
337432 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | StarcoderdataPython |
1741462 | <filename>openhab_creator/output/__init__.py
from openhab_creator.output.color import Color
| StarcoderdataPython |
203951 | # -*- coding: utf-8 -*-
from django.db import migrations
def get_document_permissions(apps):
# return a queryset of the 'add_document' and 'change_document' permissions
Permission = apps.get_model('auth.Permission')
ContentType = apps.get_model('contenttypes.ContentType')
document_content_type, _crea... | StarcoderdataPython |
12801579 | from typing import Any
import requests
from .national import NationalJSONAPI, NationalXMLAPI
from .regional import RegionalJSONAPI
class JSONClient:
def __init__(self, **kwargs: Any):
self.session = requests.Session()
self._settings = {"session": self.session, **kwargs}
self.national = N... | StarcoderdataPython |
3560321 | <reponame>kraglik/ore
from typing import Tuple, Union, Any, Callable
from ore_combinators.combinator import combinator, Combinator
from ore_combinators.parser_state import ParserState
from ore_combinators.result import Result
from ore_combinators.error import ParserError, EndOfFileError
class take_while(combinator):... | StarcoderdataPython |
11273338 | from typing import Any, Callable, Dict, List, Tuple
import argparse
from itertools import repeat
import json
from pathlib import Path
from pprint import pprint
import numpy as np
import pandas as pd
from scipy.special import expit
from sklearn import metrics
from sklearn.model_selection import RepeatedStratifiedKFold
... | StarcoderdataPython |
6477689 | <reponame>samtherussell/tesla-powerwall-controller
import requests
import json
protocol = "https://"
base_api_path = "/api"
battery_level_path = base_api_path + "/system_status/soe"
power_levels_path = base_api_path + "/meters/aggregates"
grid_connected_path = base_api_path + "/system_status/grid_status"
class Powerw... | StarcoderdataPython |
6400159 | from .furlong import Furlong | StarcoderdataPython |
135963 | import logging
import re
from collections import namedtuple
from datetime import time
import six
from six.moves.urllib.parse import (ParseResult, quote, urlparse,
urlunparse)
logger = logging.getLogger(__name__)
_Rule = namedtuple('Rule', ['field', 'value'])
RequestRate = namedtup... | StarcoderdataPython |
1877019 | #!/usr/bin/env python3
import os
import subprocess
from distutils.dir_util import copy_tree
from contextlib import contextmanager
@contextmanager
def chg_cwd(path: str):
old_cwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(old_cwd)
# check=True will raise an exception if ... | StarcoderdataPython |
3445520 | <reponame>opensource-assist/fuschia
#!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import test_env
from lib.host import Host
from process_mock import MockProcess
clas... | StarcoderdataPython |
6558101 | <reponame>trujunzhang/djzhang-targets
# coding=utf-8
import logging
import time
class HarajsTime(object):
"""
Converting the string date to time using 'GMT'.
"""
tm_minute = 0
tm_hour = 0
tm_day = 0
tm_week = 0
tm_month = 0
tm_year = 0
lang = [
"دقيقه", # "minute"
... | StarcoderdataPython |
6511261 | <reponame>ananya5254/WIE-WoC
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 3 00:20:07 2022
@author: sachi
"""
# Bubble sort in Python
def bubbleSort(array):
for i in range(len(array)):
for j in range(0, len(array) - i - 1):
if array[j] > array[j + 1]:
... | StarcoderdataPython |
210602 | """Generate the image lists for data loaders."""
import os
import sys
from os import path as osp
from ..common.logger import logger
def gen_list(
data_root: str,
data_dir: str,
list_dir: str,
phase: str,
list_type: str,
suffix: str = ".jpg",
) -> None:
"""Generate the list."""
phase_... | StarcoderdataPython |
372078 | # 测试一下lark能用
# https://lark-parser.readthedocs.io/en/latest/examples/calc.html
from lark import Lark, Transformer, v_args
calc_grammar = """
?start: sum
| NAME "=" sum -> assign_var
?sum: product
| sum "+" product -> add
| sum "-" product -> sub
?product: ... | StarcoderdataPython |
8000326 | <filename>robot.py<gh_stars>0
#!/usr/bin/env python3
import random
from fireant import FireAnt
import userControl as UC # use a custom control library
# Examples of user defined functions
def my_function(value):
# do something with value
print(value)
def light_on():
print("Light is ON")
def lig... | StarcoderdataPython |
1822255 | <gh_stars>0
from . import uct_helper_utils
from . import uct_parameters
from .. import agents
from .. import characters
from .. import constants
import numpy as np
from random import randint
class StateHelper(object):
def precompute_possible_actions(self, board):
listoflistoflists = []
for i in... | StarcoderdataPython |
8186406 | '''
Contains the following classes:
LMLexicon
'''
import os
import requests
import pandas
class LMLexicon:
'''This can only be used for non-commerical purposes only see the following
website for details:
http://sraf.nd.edu/
'''
def __init__(self):
data_path = os.path.abspath(os.path.join... | StarcoderdataPython |
6512152 | ''' extracting frames from video to improve advanced lane lines project'''
import os
import cv2
import io
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
# reading frames from video
video = cv2.VideoCapture('challenge_video.mp4')
# check if path exists. if not, create a path to store images in
if not... | StarcoderdataPython |
3251620 | <gh_stars>1-10
import cupy # temp hack around cupy-114 and torch==1.9.1+cu111 compatibility issue
import cProfile
import os
from pathlib import Path
import sys
from settings import process_arguments, Parameters
from apps.fusion.pipeline import FusionPipeline
if __name__ == "__main__":
process_arguments(help_hea... | StarcoderdataPython |
1669247 | <gh_stars>0
#!/usr/bin/env python
"""
Check rabbit for connections older than <time>
Usage:
rabbit-check-connections.py (-e host) [-h] [-d] [-p port] [-t time]
(-u username)
(-x password)
[--version]
Options:
-e <host> R... | StarcoderdataPython |
9744040 | import requests
from .auth import MpesaBase
class C2B(MpesaBase):
def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url=None, live_url=None):
MpesaBase.__init__(self, env, app_key, app_secret,
sandbox_url, live_url)
self.authentication_token = self... | StarcoderdataPython |
1807596 | from .grip_cifar10_dber import GripCifar10
from .suction_cifar10_dber import SuctionCifar10
from .grasp_cifar10_dber import GraspCifar10
from torchvision.datasets import *
import torchvision
__all__ = ('GripCifar10','SuctionCifar10', 'GraspCifar10') + torchvision.datasets.__all__
def get_mean_std(name):
assert n... | StarcoderdataPython |
6669801 | <gh_stars>1-10
# Copyright (C) 2016 <NAME> <iw<EMAIL>>
#
# 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 ... | StarcoderdataPython |
11335329 | import json
import requests
import sys
from pylons import app_globals as g
class AdzerkError(Exception):
def __init__(self, status_code, response_body):
message = "(%s) %s" % (status_code, response_body)
super(AdzerkError, self).__init__(message)
self.status_code = status_code
sel... | StarcoderdataPython |
9703546 | from rdflib.namespace import DC, OWL, RDFS, SKOS
from rdflib.plugins import sparql
def test_issue():
query = sparql.prepareQuery(
"""
SELECT DISTINCT ?property ?parent
WHERE{
?property a owl:DeprecatedProperty .
?property dc:relation ?relation .
... | StarcoderdataPython |
9613723 | #!/usr/bin/env python
# Author: <NAME>
# Date: May 29, 2018
# Class: ME 599
# File: calculate_sizes_test.py
# Description: tests for calculations for deep learning layer calculator project
import pytest
from ..calculate_sizes import *
#def test_import_all():
# """ Doesn't work because Travis
# checks if i... | StarcoderdataPython |
3371528 | <filename>backend/tests/conftest.py<gh_stars>1-10
import pytest
from backend.api import create_app
from backend.config import TestConfig
@pytest.fixture
def app():
app = create_app(TestConfig())
yield app
@pytest.fixture
def client(app):
return app.test_client()
| StarcoderdataPython |
11210765 | <gh_stars>1-10
import configparser
import re
import pytz
from common.commandline import argv
CONFIG_SECTION = 'lrrbot'
config = configparser.ConfigParser()
config.read(argv.conf)
apipass = dict(config.items("apipass"))
from_apipass = {p: u for u, p in apipass.items()}
config = dict(config.items(CONFIG_SECTION))
... | StarcoderdataPython |
1809609 | from django.contrib import admin
from .models import *
# Register your models here.
@admin.register(produtora)
class ProdutoraAdmin(admin.ModelAdmin):
list_display = ('nome',)
list_filter = ('nome',)
search_fields = ('nome',)
@admin.register(filme)
class FilmeAdmin(admin.ModelAdmin):
list_display = (... | StarcoderdataPython |
8039658 | <reponame>sireliah/polish-python<gh_stars>1-10
"""Fix incompatible imports oraz module references."""
# Authors: <NAME>, <NAME>
# Local imports
z .. zaimportuj fixer_base
z ..fixer_util zaimportuj Name, attr_chain
MAPPING = {'StringIO': 'io',
'cStringIO': 'io',
'cPickle': 'pickle',
'... | StarcoderdataPython |
6563492 | <reponame>kerenpeer/Project-Tohna-1-for-real
import sys
def initialise(k: int):
points = []
points_to_clusters = []
clusters_to_points = []
clusters_to_centroids = []
index = 0
while (True):
try:
input_point = input()
except EOFError:
# no more points in ... | StarcoderdataPython |
1889539 | """accounts URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | StarcoderdataPython |
11205528 | <reponame>JeanExtreme002/CSES-Problem-Set-Solutions<filename>Introductory Problems/weird_algorithm.py
value = int(input())
while value != 1:
print(value, end = " ")
value = int(value / 2) if value % 2 == 0 else value * 3 + 1
print(1)
| StarcoderdataPython |
4885390 | <reponame>JonHylands/uCee-py
from L3G import *
from LSM303 import *
print("Starting")
gyro = L3G()
compass = LSM303()
print("About to enableDefault")
gyro.enableDefault()
compass.enableDefault()
print("About to read")
gyro.read()
compass.read()
print("Gyro value: ", gyro.g)
print("Accel value: ", compass.a)
print("Ma... | StarcoderdataPython |
9691904 | import sys
import pprint
import wrapt
import gen_util_constants as util_constants
from google.protobuf.descriptor import Descriptor, EnumDescriptor, EnumValueDescriptor, FieldDescriptor, FileDescriptor
from typing import Tuple
pp = pprint.PrettyPrinter(indent=4, stream=sys.stderr)
Num2Type = {
1: "double",
2: "... | StarcoderdataPython |
4874018 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: candig/schemas/candig/metadata_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.proto... | StarcoderdataPython |
296458 | """
Iso-tropic filtering and compression as discussed with <NAME>.
For more check-out the Book.
Write down the latex equation.
todo:
OT = optimize
remove the unessary print statements
swap is not correct for the filtering.
comments are not proper
done:
better variable names
"""
from time import time
import pyopencl... | StarcoderdataPython |
3313096 | #[1]
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory
... | StarcoderdataPython |
366884 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import downward.suites
import common_setup
import configs
CONFIGS = configs.default_configs_optimal(ipc=False, extended=False)
print(sorted(CONFIGS.keys()))
print(len(CONFIGS))
SUITE = downward.suites.suite_optimal_with_ipc11()
SCATTER_ATTRIBUTES = ["total_time"]
exp... | StarcoderdataPython |
3203562 | # Copyright PA Knowledge Ltd 2021
# For licence terms see LICENCE.md file
import copy
import unittest
import verify_config
class VerifyConfigTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.schema = {"properties": {"ingress": {"type": "object"},
"egress... | StarcoderdataPython |
217768 | import os
import uuid
from dataclasses import dataclass
from datetime import datetime
from . import FilePath, DirPath, Topic
from .util import create_directory, FileCreationException, DirectoryCreationException, create_file_from_str_to, \
create_file_from_dict_to
from .console_logging import print_success_step, pr... | StarcoderdataPython |
1671994 | <reponame>ruslanmv/BOT-MMORPG-AI
from AutoHotPy import AutoHotPy
from InterceptionWrapper import *
def exitAutoHotKey(autohotpy,event):
autohotpy.stop()
def recorded_macro(autohotpy, event):
autohotpy.moveMouseToPosition(384,474)
autohotpy.sleep(0)
stroke = InterceptionMouseStroke()
stroke.state = I... | StarcoderdataPython |
6431899 | from __future__ import print_function
from argparse import ArgumentParser
import os
import sys
try:
from catkin_pkg.workspaces import order_paths
except ImportError as e:
sys.exit('ImportError: "from catkin_pkg.package import parse_package" failed: %s\nMake sure that you have installed "catkin_pkg", it is up ... | StarcoderdataPython |
4850057 | <gh_stars>0
""":mod:`wand.version` --- Version data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can find the current version in the command line interface:
.. sourcecode:: console
$ python -m wand.version
0.0.0
$ python -m wand.version --verbose
Wand 0.0.0
ImageMagick 6.7.7-6 2012-06-03 Q16 http://www... | StarcoderdataPython |
3309476 | <reponame>manishwins/Greenline<filename>landlord/migrations/0012_auto_20210629_1203.py<gh_stars>0
# Generated by Django 3.1.7 on 2021-06-29 12:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('landlord', '0011_auto_20210609_0631'),
]
operation... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.