id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
1902926 | <filename>delivery/client.py<gh_stars>0
import requests
import gci.componentmodel as cm
import ci.util
class DeliveryServiceRoutes:
def __init__(self, base_url: str):
self._base_url = base_url
def component_descriptor(self):
return 'http://' + ci.util.urljoin(
self._base_url,
... | StarcoderdataPython |
5171735 | n = int(input())
result = ((n + n) * n - n) // n
print(result)
| StarcoderdataPython |
6631765 | <gh_stars>1-10
from kivy.app import App
from kivy.uix.textinput import TextInput
class SimpleApp(App):
def build(self):
t = TextInput(font_size=150)
return t
if __name__ == "__main__":
SimpleApp().run()
| StarcoderdataPython |
3560396 | <reponame>Extreme-classification/ECLARE<filename>ECLARE/libs/model.py
from xclib.utils.sparse import topk, retain_topk
import xclib.evaluation.xc_metrics as xc
from .model_base import ModelBase
import libs.features as feat
import scipy.sparse as sp
from sklearn.preprocessing import normalize
import numpy as np
import t... | StarcoderdataPython |
244911 | <filename>surf/rf.py
# -*- coding: utf-8 -*-
"""
/*------------------------------------------------------*
| Spatial Uncertainty Research Framework |
| |
| Author: <NAME>, UC Berkeley, <EMAIL> |
| ... | StarcoderdataPython |
1756405 | <reponame>trachpro/Emotion_recognition<filename>test.py
import numpy as np
import cv2
import imutils
import time
from keras.preprocessing.image import img_to_array
from keras.models import load_model
import numpy as np
detection_model_path = 'haarcascade_files/haarcascade_frontalface_default.xml'
emotion_model_path = ... | StarcoderdataPython |
1925658 | <gh_stars>1-10
"""Quantum Inspire library
Copyright 2019 <NAME>
qilib is available under the [MIT open-source license](https://opensource.org/licenses/MIT):
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 th... | StarcoderdataPython |
3580129 | from collections import Counter, defaultdict, OrderedDict
li = [1, 2, 4, 3, 4, 4, 5, 6, 6, 7, 8]
print(Counter(li)) # Counter({4: 3, 6: 2, 1: 1, 2: 1, 3: 1, 5: 1, 7: 1, 8: 1})
dict = defaultdict(int, {'a': 1, 'b': 2, 'c': 4})
print(dict['d']) # 0
dict2 = defaultdict(lambda: "value does not exist", {'a': 1, 'b': 2})
... | StarcoderdataPython |
174559 | def say(words):
print words
name = "this is a import demo"
| StarcoderdataPython |
9685955 | <reponame>rgg81/Neural-Fictitous-Self-Play<filename>NFSP/workers/la/action_buffer/_ActionReservoirBufferBase.py
# Copyright (c) 2019 <NAME>
class ActionReservoirBufferBase:
def __init__(self, env_bldr, max_size, min_prob):
self._env_bldr = env_bldr
self._max_size = max_size
self._min_prob... | StarcoderdataPython |
6169 | <reponame>canovasjm/InterviewProject_JuanCanovas
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 1 18:17:07 2021
@author: jm
"""
# %% required libraries
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
# %% connect to DB
# create connection using pymssql
engine = cr... | StarcoderdataPython |
11385140 | from __future__ import print_function
import argparse
import logging
from trekipsum import dialog, markov
logger = logging.getLogger(__name__)
def positive(value):
"""Type check value is a natural number (positive nonzero integer)."""
value = int(value)
if value < 1:
raise ValueError()
retu... | StarcoderdataPython |
1981645 | import textgrid
import sys
def cut(input):
tg = textgrid.TextGrid()
tg.read(input)
# print(tg.tiers[0].minTime, tg.tiers[0].maxTime)
# nums = len(tg.tiers[0].intervals)
intervals = tg.tiers[0].intervals
start = tg.tiers[0].minTime
end = tg.tiers[0].maxTime
if intervals[0].mark == 'silen... | StarcoderdataPython |
3409739 | import os
from typing import Generator
from unittest.mock import patch
import pytest
from twitterapiv2.appauth_client import AppAuthClient
from tests.fixtures.mock_http import MockHTTP
MOCK_KEY = "<KEY>"
MOCK_SECRET = "<KEY>"
MOCK_CRED = "eHZ6MWV2RlM0d0VFUFRHRUZQSEJvZzpMOHFxOVBaeVJnNmllS0dFS2hab2xHQzB2SldMdzhpRUo4OE... | StarcoderdataPython |
6588412 | <filename>api/serializers.py
from .models import Home
from rest_framework import serializers
class HomeSerializer(serializers.HyperlinkedModelSerializer):
unpublished_page_data = serializers.CharField(required=False, allow_null=True, allow_blank=True)
class Meta:
model = Home
fields = ('guid',... | StarcoderdataPython |
6698315 | <filename>start_training_with_all_avaliable_gpus/start.py
#-*-coding:utf-8-*-
import sys
import os
import json
import numpy as np
import multiprocessing
import datetime
import pynvml
from pynvml import *
nvmlInit()
MEMORY_THESHOLD = 15 # GB
def get_aviliable_gpus():
print ("Driver Version:", nvmlSystemGetDriverVe... | StarcoderdataPython |
3223576 | from pyspark import SparkContext, SparkConf, SparkFiles
from pyspark.sql import SQLContext, Row
import configparser
import os
from vina_utils import get_files_log
from json_utils import create_jsondata_from_docking_output_file, create_json_file
from os_utils import make_directory
def log_to_json(log_file):
... | StarcoderdataPython |
5077330 | <reponame>RAVIKANT-YADAV/AI-based-Digital-Voice.-assistance
import speak_Function as sf
import wikipedia
def wikipedia_query():
if 'wikipedia' in query:
sf.speak("Searching............")
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
... | StarcoderdataPython |
148155 | <reponame>ir4n6/aws-security-automation
# MIT No Attribution
# 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... | StarcoderdataPython |
6627865 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""Check the application dependencies."""
import sys
from pineboolib.core.utils import logging
from pineboolib.core.utils.utils_base import is_deployed
from pineboolib.core.utils.check_dependencies import get_dependency_errors
from pineboolib.core.utils.check_dependencies import ... | StarcoderdataPython |
3347874 | <filename>neural_spline_flows/nde/transforms/svd.py<gh_stars>0
import numpy as np
import torch
from torch import nn
from torch.nn import init
from neural_spline_flows.nde import transforms
from neural_spline_flows.nde.transforms.linear import Linear
class SVDLinear(Linear):
"""A linear module using the SVD deco... | StarcoderdataPython |
8158698 | STATION_TABLE = []
from itertools import combinations
import numpy as np
class Scheduler:
def __init__(self, total, n, p, alpha, beta):
# self.opt = opt
self.station_num = n
self.time = p
self.total = total
self.station_table = init_table(n, p)
self.alpha = alpha
... | StarcoderdataPython |
4827732 | <reponame>Zbot21/zcoins<filename>zcoins/exchanges/exchange.py
# This file contains the interface that should be implemented by an exchange.
from __future__ import annotations
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Text, Callable, Union
from zcoins.exchanges import Ord... | StarcoderdataPython |
3405530 | <reponame>tobyatgithub/PythonDataStructureAndAlgo
"""
Similar to maxheap, here we have a class for min heap.
Implementing via array
"""
class minHeap():
def __init__(self, A, DEBUG=False):
self.A = A
self.LEN = len(A)
self.DEBUG = DEBUG
self.buildMinHeap()
def getLeftIndex(sel... | StarcoderdataPython |
314470 | import pytest
import json
from runeatest import testreporter
def test_add_all_passed_test_cases(mocker):
x = '{"tags": {"opId": "ServerBackend-f421e441fa310430","browserUserAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","orgId": "100939161759802... | StarcoderdataPython |
1853998 | <reponame>NikaEgorova/goiteens-python3-egorova
Ned = {"Інструменти для лівшів", "Зелений чай", "Шоколад"}
Gomer = {"Піцу", "Премію на роботі",
"Касети з всіма випусками Клоуна Красті", "Шоколад"}
i = Ned.intersection(Gomer)
print(i)
| StarcoderdataPython |
3231785 | <gh_stars>0
"""
LC621 task scheduler
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks. Tasks could be done without original order. Each task could be done in one interval. For each interval, CPU could finish one task or just be id... | StarcoderdataPython |
5101832 | import configparser
config = configparser.ConfigParser()
config.read('config.ini')
if config['IHC']['ODTC'] == "True":
from .odtcFinder import OdtcFinderWrapper
from .odtc import DataEventOdtcSensorValue, OdtcWrapper
from .odtcConfigXml import OdtcConfigXmlWrapper
from .odtcParamsXml import OdtcParamsXm... | StarcoderdataPython |
282759 | from itertools import groupby
from operator import itemgetter
def summary(data, key=itemgetter(0), field=itemgetter(1)):
""" Summarise the given data (a sequence of rows), grouped by the
given key (default: the first item of each row), giving totals
of the given field (default: the second item of ea... | StarcoderdataPython |
1998289 | from cryptography import x509
from cryptography.x509.oid import ExtensionOID
from cryptography.x509.oid import ObjectIdentifier
from cryptography.hazmat.backends import default_backend
import asn1
import struct
# This is a very simplistic ASN1 parser. Production code should use
# something like ans1c to build a parser... | StarcoderdataPython |
6438264 | import timeago
import datetime
from datetime import timezone
from doing.utils import run_command, get_repo_name, replace_user_aliases, validate_work_item_type
from rich.table import Table
from rich.live import Live
from rich.progress import track
from rich.console import Console
from typing import List, Dict
console... | StarcoderdataPython |
6657363 | <gh_stars>1-10
# Copyright 2018 The glTF-Blender-IO 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 |
3395791 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Dict, List, Optional, Tuple
from detectron2.config import configurable
from detectron2.layers import ShapeSpec, cat, get_norm
from detectron2.modeling import PROP... | StarcoderdataPython |
11390464 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=unused-argument, attribute-defined-outside-init, eval-used
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
class MainApp(App):
def build(self):
sel... | StarcoderdataPython |
6695124 | <gh_stars>100-1000
# Copyright 2021 Peng Cheng Laboratory (http://www.szpclab.com/) and FedLab Authors (smilelab.group)
# 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... | StarcoderdataPython |
6613364 | class BubbleSort:
def __init__(self,a):
self.a = a
def result(self):
for i in range(len(self.a)):
for j in range(i+1,len(self.a)):
if self.a[i] > self.a[j]:
self.a[i],self.a[j] = self.a[j],self.a[i]
return self.a
| StarcoderdataPython |
1979663 | """Simple multi-layer perception neural network on MNIST."""
import argparse
import os.path
import struct
import time
import numpy as real_numpy
import minpy.core as core
import minpy.numpy as np
from minpy.nn import io
from minpy.nn import layers
import minpy.nn.model
import minpy.nn.solver
from minpy.utils.minprof i... | StarcoderdataPython |
3254999 | """
Library Features:
Name: lib_gsmap_time
Author(s): <NAME> (<EMAIL>)
Date: '20200302'
Version: '1.5.0'
"""
#######################################################################################
# Library
import logging
import pandas as pd
from src.hyde.algorithm.settings.satellite.gsma... | StarcoderdataPython |
8190469 | <reponame>ghsecuritylab/project-powerline
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import threading
import atexit
import logging
class powerline_prototype(threading.Thread):
def __init__(self, dbScoped, semCtrl, semNext):
super(powerline_prototype, self).__init__(name='prototype')
self.log ... | StarcoderdataPython |
9740884 | <filename>shapes.py
from functions import *
import constants as const
from math import sin,cos,radians,pi
from visualization import arr2png, png2arr,rotate
from random import randint as ri
class Square:
'''
Give side in milli-meter( mm ) and angle in degrees( ° )
'''
def __init__(self,side,angle=0):
... | StarcoderdataPython |
8005180 | from django.db import models
from django.utils.safestring import mark_safe
class Identity(models.Model):
first_name = models.CharField(max_length=30, null=True)
last_name = models.CharField(max_length=30, null=True, help_text=mark_safe("<strong>Here's some HTML!</strong>"))
class Person(models.Model):
i... | StarcoderdataPython |
3641 | <gh_stars>10-100
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
An `image.layer` is a set of `feature` with some additional parameters. Its
purpose to materialize those `feature`s as a... | StarcoderdataPython |
11235848 | # If you want to use IPv6, then:
# - replace AF_INET with AF_INET6 everywhere
# - use the hostname "2.pool.ntp.org"
# (see: https://news.ntppool.org/2011/06/continuing-ipv6-deployment/)
import trio
import struct
import datetime
def make_query_packet():
"""Construct a UDP packet suitable for querying an NTP serv... | StarcoderdataPython |
1706223 | """Contains a batch class to segmentation task."""
import numpy as np
from PIL import Image
from batchflow import ImagesBatch, action, inbatch_parallel
class MnistBatch(ImagesBatch):
"""
Batch can create images with specified size and noisy with parts of other digits.
"""
components = 'images', 'labe... | StarcoderdataPython |
11374098 | <filename>aoc20181203a.py
def parse(line):
id, __, pos, size = line.split()
return (
id[1:],
[int(x) for x in pos[:-1].split(",")],
[int(x) for x in size.split("x")],
)
def aoc(data):
cloth = {}
for _, [x, y], [dx, dy] in [parse(cut) for cut in data.split("\n")]:
fo... | StarcoderdataPython |
1774650 | #!/usr/bin/env/python
# -*- coding: utf-8 -*-
# flake8: noqa
__title__ = 'ciscoipphone'
__version__ = '0.1.0'
__author__ = '<NAME>'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2015 <NAME>'
# from . import base, services, utils
#
# __all__ = [base, services, utils]
# Set default logging handler to avoid "No... | StarcoderdataPython |
5054837 | <gh_stars>0
from collections import defaultdict
import sys
class Graph:
def __init__(self, V):
self.V = V
self.graph=defaultdict(list)
self.indegree = [0]*(self.V)
self.outdegree = [0]*(self.V)
def Check(self):
for ele in range(self.V):
if(self.indegree[ele]... | StarcoderdataPython |
121831 | <filename>zbarcam/zbarcam.py<gh_stars>0
import os
from collections import namedtuple
import PIL
import zbarlight
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ListProperty
from kivy.uix.anchorlayout import AnchorLayout
from kivy.utils import platform
#... | StarcoderdataPython |
6534661 | <reponame>deepakkt/aasaan
# -*- coding: utf-8 -*-
"""
Create ORS programs for newly defined programs in Aasaan
"""
from datetime import date
import json
from collections import Counter
from django.core.management.base import BaseCommand
from schedulemaster.models import ProgramSchedule, ProgramScheduleCou... | StarcoderdataPython |
9706782 | <gh_stars>1-10
import datetime
import pytest
import edera.helpers
from edera import routine
from edera import Timer
from edera.consumers import BasicConsumer
from edera.exceptions import StorageOperationError
from edera.invokers import MultiThreadedInvoker
from edera.monitoring import MonitoringAgent
from edera.moni... | StarcoderdataPython |
1669675 | """
Checks each line of a file for valid emails.
Use Django's email validator regex.
Store the result in one of 2 files:
1. valid emails.
2. invalid emails.
NOTE: This project still fails on a case when the email has a trailing string. This is because the re.match() method only matches the beginning of the ... | StarcoderdataPython |
1827616 | <filename>ssseg/modules/models/segmentors/isanet/isanet.py
'''
Function:
Implementation of ISANet
Author:
<NAME>
'''
import copy
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..base import BaseModel
from ..base import SelfAttentionBlock as _SelfAttentionBlock
from ...backbo... | StarcoderdataPython |
3432138 | <gh_stars>1-10
from django.conf.urls import include, patterns, url
from django.views.decorators.cache import never_cache
from . import views
services_patterns = patterns(
'',
url('^paypal$', never_cache(views.paypal), name='amo.paypal'),
)
urlpatterns = patterns(
'',
('', include(services_patterns)),... | StarcoderdataPython |
8105528 | ##########################################################################
# NSAp - Copyright (C) CEA, 2013 - 2018
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
###... | StarcoderdataPython |
5150924 | <reponame>iamrajee/ROS<filename>panda/scripts/pick_and_place_simple.py<gh_stars>10-100
#!/usr/bin/env python
import rospy
from moveit_python import *
from moveit_msgs.msg import Grasp, PlaceLocation
object_name="my_cube"
# object_name="my_box1"
rospy.init_node("moveit_py")
s = PlanningSceneInterface("panda_link0")
s... | StarcoderdataPython |
1852194 | <reponame>tactlabs/randum
def test_unique_clears(testdir):
"""Successive uses of the `randum` pytest fixture have the
generated unique values cleared between functions."""
testdir.makepyfile(
"""
import pytest
from randum.exceptions import UniquenessException
NUM_SAMPLES = ... | StarcoderdataPython |
9708761 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\multimatte_interface.ui'
#
# Created: Fri Jan 22 08:18:32 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Form(object):
def ... | StarcoderdataPython |
6553435 | <reponame>georgsp/mdmTerminal2<filename>scripts/tester.py
#!/usr/bin/env python3
import base64
import cmd as cmd__
import hashlib
import json
import socket
import time
from threading import Thread, Lock
ERRORS = (BrokenPipeError, ConnectionResetError, ConnectionRefusedError, OSError)
CRLF = b'\r\n'
class Client:
... | StarcoderdataPython |
4863310 | <filename>checa.py
# Funções auxiliares que transformam posições entre coordenadas
# (andar, linha, coluna) e número inteiro (entre 1 e 64)
def posicao(
pos_int
):
"""
Transforma a posição, dada em termos de um número inteiro
entre 1 e 64, e uma tupla de coordenadas.
"""
pos_int -... | StarcoderdataPython |
9789480 | <reponame>Mishuni/Collect_Environ_Data
from city_air_collector import CityAirCollector
from city_weather_collector import CityWeatherCollector
from influxdb_management.influx_crud import InfluxCRUD
import influxdb_management.influx_setting as ifs
import datetime, time
import urllib3, logging
def log_setup():
form... | StarcoderdataPython |
11331377 | """
Created at 07.11.19 19:12
@author: gregor
"""
from setuptools import setup
from torch.utils import cpp_extension
setup(name='sandbox_cuda',
ext_modules=[cpp_extension.CUDAExtension('sandbox', ['src/sandbox.cpp', 'src/sandbox_cuda.cu'])],
cmdclass={'build_ext': cpp_extension.BuildExtension}) | StarcoderdataPython |
9611202 | # coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
from over_sample import smote
# In[2]:
def reduce_mem_usage(df):
""" iterate through all the columns of a dataframe and modify the data type
to reduce memory usage.
"""
start_mem = df.memory_usage().sum() / 1024**2
pr... | StarcoderdataPython |
1610159 | <reponame>polycart/polycart<filename>PolyCart/server/goodsdb.py
import sqlite3
class GoodsDataBase:
def __init__(self):
self.database = sqlite3.connect('goods.db', check_same_thread = False)
self.c = self.database.cursor()
try:
self.c.execute("""create table goods
(code text primary key,
name text... | StarcoderdataPython |
3292814 | <gh_stars>0
from django.contrib import admin
from django.urls import reverse
from django.utils.translation import gettext as _
from django.template.defaultfilters import safe
from .models import Scope, Key
def get_event_ical_link(obj):
if not obj.scopes.filter(name="export_ical").exists():
return _("Miss... | StarcoderdataPython |
1704443 | <gh_stars>1-10
import controllers.config as cfg
import pymongo
from flask import g
from pymongo.mongo_client import MongoClient
client = None
def get_db():
if 'db' not in g:
g.db = client.get_database(cfg.APP_CONFIG_DB_NAME)
return g.db
def init_db():
global client
client = MongoClient(cfg.... | StarcoderdataPython |
5184266 | """
Django settings for server project.
Generated by 'django-admin startproject' using Django 2.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
imp... | StarcoderdataPython |
8134167 | import asyncio
import re
from datetime import datetime
from logging import getLogger
from os import makedirs
from os.path import exists, join
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Tuple
from aiohttp import ClientError
from .abc import GenericModelList, Model
from .group import Group
from .mixin... | StarcoderdataPython |
1627137 | <reponame>kkauder/spack
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cleverleaf(CMakePackage):
"""CleverLeaf is a hydrodynamics mini-ap... | StarcoderdataPython |
171889 | <filename>test/setup.py
import os
def before_each():
# blank file
open('blank', 'w').close()
# with headers and comments
with open('headers', 'w') as headers:
headers.write('total,date\n')
headers.write('00:15:00,00:15:00,900,900,1970-01-01T00:00:00\n')
headers.write('this is a comment\n')
# wi... | StarcoderdataPython |
295584 | <filename>cyborg_enhancement/mitaka_version/cyborg/cyborg/objects/physical_function.py
# Copyright 2018 Huawei Technologies Co.,LTD.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# ... | StarcoderdataPython |
9625855 | <reponame>gatsinski/investments<filename>investments/contrib/payments/models.py
import uuid
from django.contrib.auth import get_user_model
from django.core import validators
from django.db import models
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from investment... | StarcoderdataPython |
5075439 | <reponame>Pondorasti/BEW-1.2<filename>Class Work/final-project/final_app/config.py
import os
from dotenv import load_dotenv
load_dotenv()
class Config(object):
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.getenv('SECRET_KEY')
| StarcoderdataPython |
3375448 | # coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... | StarcoderdataPython |
6424013 | <filename>PupilDetector.py
# Eye Centre Localisation using Means of Gradients
# Implementation of paper by <NAME> and <NAME>
# "Accurate Eye Centre Localisation by Means of Gradients"
# Author: <NAME>
# Increase speed of locate by increasing the accuracy variable
# The algorithm takes a sample ones every accuracy*accu... | StarcoderdataPython |
6462820 | <gh_stars>1-10
from .common import ILElement, split_tokens
from .parameter import ILParameter
from .fragment import CFragment, CVectorizedString, CVectorizedArray, CBlock
from .local import ILLocal
from .block import ILBlock
class ILMethod(ILElement):
next_label_number = 0
def __init__(self, lines, start):
de... | StarcoderdataPython |
6542454 | <reponame>jason-neal/companion_simulations
# coding: utf-8
# # Interpolate wavelength on multiple dimensions
#
# <NAME> - 19th July 2017
# To try and interpolate N-D data along the first axis.
#
# This is to be able to perfrom chisquare analsysis for many parameters.
# In[ ]:
import numpy as np
import scipy as sp
... | StarcoderdataPython |
11201062 | """Solutia problemei Reprezentarea unui director ca arbore"""
from __future__ import print_function
import os
def representastree(path_to_dir, depth=0):
"""Reprezentarea unui director ca arbore"""
files_in_dir = os.listdir(path_to_dir)
for filename in files_in_dir:
print ('\t' * depth, ... | StarcoderdataPython |
17623 | import balanced
balanced.configure('ak-test-1o9QKwUCrwstHW<KEY>')
order = balanced.Order.fetch('/orders/OR7qAh5x1cFzX0U9hD628LPa') | StarcoderdataPython |
238040 | <reponame>enyachoke/saleor
from enum import Enum
from django.conf import settings
from django.core.checks import register, Warning
TOKEN_PATTERN = ('(?P<token>[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}'
'-[0-9a-z]{12})')
@register()
def check_session_caching(app_configs, **kwargs): # pragma: n... | StarcoderdataPython |
5036283 | <reponame>Ekhel/Surya<filename>suryaenv/bin/django-admin.py<gh_stars>0
#!/home/ekhel/Documents/django/Surya/suryaenv/bin/python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| StarcoderdataPython |
1800431 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import logging
logger = logging.getLogger('merge')
logger.setLevel(logging.DEBUG)
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
file_name = ['as', 'cityu', 'msr', 'pku', 'nlpcc']
data_name = "data.txt"
current_path = os.path.abspat... | StarcoderdataPython |
11226728 | <reponame>CrisDS81/copulae
from abc import ABC
from typing import Collection, Tuple, Union
import numpy as np
from copulae.copula import BaseCopula, Param
from copulae.core import EPS, create_cov_matrix, is_psd, near_psd, tri_indices
from copulae.utility.annotations import *
class AbstractEllipticalCopula(BaseCopul... | StarcoderdataPython |
11279840 | from flask import request, flash, url_for
from conekt.extensions import admin_required
from werkzeug.exceptions import abort
from werkzeug.utils import redirect
from conekt.controllers.admin.controls import admin_controls
from conekt.forms.admin.add_expression_specificity import AddConditionSpecificityForm, AddTissueS... | StarcoderdataPython |
5084120 | # -*- coding: utf-8 -*-
"""This module contains the RepoComment class."""
from __future__ import unicode_literals
from .. import models
from .. import users
from ..decorators import requires_auth
class _RepoComment(models.GitHubCore):
"""The :class:`RepoComment <RepoComment>` object.
This stores the inform... | StarcoderdataPython |
1751369 | from flask import Flask, request
from flask_cors import CORS
from flask_restx import Api, Resource
from flask_jwt_extended import JWTManager
from datetime import timedelta, datetime
from pytz import timezone
from dotenv import load_dotenv
from boto3 import resource
from os import getenv
from werkzeug.security import ge... | StarcoderdataPython |
9748711 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('management', '0016_demoresourcedata_validation_result'),
]
operations = [
migrations.AlterField(
model_name='dem... | StarcoderdataPython |
12834073 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 28 05:39:18 2019
@author: ladvien
"""
from time import sleep, time
"""
MOTOR_NUM:
X = 0
Y = 1
Z = 2
E0 = 3
E1 = 4
PACKET_TYPES
0x01 = motor_write
0x02 = motor_halt
DIRECTIO... | StarcoderdataPython |
193712 | <reponame>umyuu/Sample
# -*- coding: utf-8 -*-
import requests
import bs4
import pandas as pd # pandas
def main():
html ="""
<ul id="front">
<li class="icon-01">乗用車</li>
<li class="icon-02">トラック</li>
<li class="icon-11">軽自動車</li>
</ul>
"""
soup = bs4.BeautifulSoup(html,... | StarcoderdataPython |
1894889 | <reponame>liusida/thesis-bodies
# pick 16
# 801.2.1 All 16*4 robots selected (add a mark to 801.1.results).
# 801.2.2 The distribution of learnability per type. (histogram or density plot with y-axis represents the learnability) (add a threshold to show our selection) (add another line to indicate the baseline as a hor... | StarcoderdataPython |
1666870 | <filename>pbxplore/structure/loader.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
# Local module
from .structure import Chain, Atom
from .PDB import PDB
# Conditional import
try:
import MDAnalysis
except ImportError:
IS_MDANALYSIS = False
else:
IS_MDANALYSIS = T... | StarcoderdataPython |
11326435 | """Configurations fixed for library"""
from dataclasses import dataclass
from typing import Dict, List
import tyaml
from ocomone import Resources
@dataclass(frozen=True)
class BaseConfiguration:
"""Base configuration class"""
name: str
params: dict
@dataclass(frozen=True)
class AlertaConfiguration:
... | StarcoderdataPython |
252023 | <filename>src/python/examples/factor_analysis.py<gh_stars>0
from quipp import *
def run():
num_components = 2
point_dim = 5
ComponentsType = Vector(num_components, Double)
PointType = Vector(point_dim, Double)
get_point = rand_function(ComponentsType, PointType)
def sample():
components = [normal(0,... | StarcoderdataPython |
6446641 | <gh_stars>0
from classes.grid import Hexgrid
from classes.hex import Hex
from utils.funcs import face_hex_to_cube, cube_line, wedge_hex
import numpy as np
import matplotlib.pyplot as plt
grid_size = 5
grids = []
num_grids = 16
num_cols = 4
num_rows = 4
num_rivers = 1
num_mountains = 2
num_forests = 1
forest_radius = ... | StarcoderdataPython |
5166960 | <gh_stars>1-10
# pylint: disable=missing-docstring,no-self-use,protected-access
"""
Copyright 2017 ARM Limited
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/LICE... | StarcoderdataPython |
3573658 | <reponame>jacksonicson/paper.IS2015
'''
Java is used to get the length of all log messages stored in sonar. The length of
each log message is stored in a txt file. This file gets read by this script which then
calculates some descriptive statistic metrics about the log message length.
'''
import numpy as np
########... | StarcoderdataPython |
6492168 | <gh_stars>1-10
import face_recognition
if __name__ == '__main__':
image = face_recognition.load_image_file('images/zhouwei.jpg')
# 自动查找图片中的所有面部
face_locations = face_recognition.face_locations(image)
print(face_locations) | StarcoderdataPython |
187425 | <filename>build/PureCloudPlatformClientV2/models/coaching_notification.py<gh_stars>1-10
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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 Licens... | StarcoderdataPython |
8036757 | <reponame>pabvald/instagram-caption-generator
from evaluation import eval
import json
import argparse
with open('examples/gts.json', 'r') as f:
gts = json.load(f)
with open('examples/res.json', 'r') as f:
res = json.load(f)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Image Ca... | StarcoderdataPython |
1970808 | <reponame>ssd04/ml-project-template
import logging
import os
import sys
import traceback
from loguru import logger
LOCAL_DEV = os.getenv("LOCAL_DEV")
def log_exception(*args):
"""[Captures the fullstack trace of uncaught exceptions, and provides them in a structured format]"""
if len(args) == 1:
... | StarcoderdataPython |
4946923 | from pyhanlp import *
from pyhanlp.static import download, remove_file, HANLP_DATA_PATH
import zipfile
import os
def test_data_path():
"""
获取测试数据路径,位于$root/data/test,根目录由配置文件指定。
:return:
"""
data_path = os.path.join(HANLP_DATA_PATH, 'test')
if not os.path.isdir(data_path):
os.mkdir(da... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.