id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
8119425 | <reponame>ThomasHoppe/pyflux<filename>setup.py<gh_stars>1000+
import io
import os
import re
import sys
import subprocess
# Use of SETUP built-in adapted from scikit-learn's setup structure.
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
builtins.__PYFLUX_SETUP__ = True
PACK... | StarcoderdataPython |
291847 | <reponame>Lifespark-Technologies/Infomed
from rest_framework_gis import serializers as gis_serializers
from rest_framework import serializers
from .models import Hospital, AppointmentSlot
from django.core.exceptions import ValidationError
class AppointmentSlotSerializer(gis_serializers.ModelSerializer):
"""
T... | StarcoderdataPython |
5126750 | <reponame>daochenzha/SimTSC
import os
import uuid
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data
class ResNetTrainer:
def __init__(self, device, logger):
self.device = device
self.logger = logger
self.tmp_dir = 'tmp'
... | StarcoderdataPython |
1602912 | from PyQt5.QtWidgets import *
from DownloadListWidget import DownloadListWidget
class Workspace(QWidget):
def __init__(self, parent=None):
super(QWidget, self).__init__(parent)
self.layout = QVBoxLayout()
self.setLayout(self.layout)
self.downloadList = DownloadListWidget(self)
... | StarcoderdataPython |
240462 | <reponame>ankostis/graphkit
# Copyright 2020, <NAME>.
# Licensed under the terms of the Apache License, Version 2.0. See the LICENSE file associated with the project for terms.
"""A builder that Render graphtik plots from doctest-runner's globals."""
from collections import OrderedDict
from pathlib import Path
from typ... | StarcoderdataPython |
11258822 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: common.py
# Author: <NAME> <<EMAIL>>
# Modified: <NAME> <<EMAIL>>
import random
import time
import threading
import numpy as np
from tqdm import tqdm
import multiprocessing
from six.moves import queue
# from tensorpack import *
# from tensorpack.utils.stats import... | StarcoderdataPython |
3448750 | <reponame>Ishayahu/MJCC-tasks<filename>assets/models.py
# -*- coding:utf-8 -*-
# coding=<utf8>
from django.db import models
##from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext as _
# Модели для подключения активов
class Asset(models.Model):
asset_type = models.F... | StarcoderdataPython |
1788158 | import re
from tweepy import Status
from updatesproducer.updateapi.update import Update
from twitterproducer.updateapi.media_factory import MediaFactory
TWITTER_BASE_URL = 'https://www.twitter.com'
class UpdateFactory:
@staticmethod
def to_update(tweet: Status):
user_id = tweet.user.screen_name
... | StarcoderdataPython |
3370833 | <reponame>achalumeau/enterprise_extensions<filename>tests/test_os.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `enterprise_extensions` package."""
import json
import logging
import os
import pickle
import numpy as np
import pytest
from enterprise.signals import signal_base, gp_signals, parameter, u... | StarcoderdataPython |
8076990 | <reponame>TimGudlewski/wiki-film-scraper<filename>src/wfs/helpers/info.py
headers = {
'Access-Control-Allow-Origin': "*",
'Access-Control-Allow-Methods': "GET",
'Access-Control-Allow-Headers': "Content-Type",
'Access-Control-Max-Age': "3600",
'User-Agent': "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv... | StarcoderdataPython |
6600451 | '''
Copyright (c) 2013 <NAME> <<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 or agreed to in writing, so... | StarcoderdataPython |
3366945 | import datetime
import sphinx_rtd_theme
import doctest
import torch_scatter
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx_autodoc_typehints',
]
s... | StarcoderdataPython |
8110162 | # coding: utf-8
# author: sgr
def table_filter(request, admin_class):
filter_conditions = {}
for k, v in request.GET.items():
if k == 'page':
continue
if v:
filter_conditions[k] = v
print(filter_conditions)
return admin_class.model.objects.filter(**fil... | StarcoderdataPython |
1698324 | import h5py
import kaldiio
import numpy as np
import pytest
from espnet.utils3.training.batchfy import make_batchset
from test3.utils_test import make_dummy_json
@pytest.mark.parametrize("batch_size", [4, 8])
def test_get_batch(batch_size):
dummy_json = make_dummy_json(128, [40, 100], [50, 800])
batches = m... | StarcoderdataPython |
9665999 | <reponame>fudan-cyma/KafkaDashboard<filename>scripts/streaming.py
from pyspark.streaming.kafka import KafkaUtils
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
import sys
import json
sc = SparkContext.getOrCreate()
sc.stop()
sc = SparkContext(appName = "PythonStreamingReciever")
ssc = ... | StarcoderdataPython |
9681881 | from django.contrib import admin
from django.contrib.auth.models import Group
# Register your models here.
from django.contrib import admin
from .models import Customer, Product, RAWM, Supplier, Department, Employee, Order, OrderProduct, OrderRAWM
admin.site.site_header = 'Global Solution Package Admin'
class OrderA... | StarcoderdataPython |
1841465 | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
from base import BaseObject
class GraphNodeIdGenerator(BaseObject):
""" Build a GitHub Node for Graphviz """
def __init__(self,
a_type: str,
a_label: str,
is_debug: bool = True):
"""
Created:
... | StarcoderdataPython |
9725050 | <filename>peering/tests/test_api.py
from unittest.mock import patch
from django.urls import reverse
from rest_framework import status
from net.models import Connection
from peering.constants import *
from peering.enums import BGPRelationship, CommunityType, DeviceState, RoutingPolicyType
from peering.models import (
... | StarcoderdataPython |
1627902 | <gh_stars>0
from django.contrib import admin
from .models import AccessToken
@admin.register(AccessToken)
class AccessTokenAdmin(admin.ModelAdmin):
list_display = ('create', 'expires_in', 'key')
| StarcoderdataPython |
1677989 |
# <NAME>
# Last Change : 2007-07-23 10:50
from __future__ import absolute_import
"""
Module containing the core optimizers
Optimizers :
- Optimizer
- a skeletton for defining a custom optimizer
- calls iterate until the criterion indicates that the optimization has converged
- StandardOptimizer
- ta... | StarcoderdataPython |
283447 | <filename>test.py
from path_dict import PathDict
from typing import Callable
import copy
import time
import traceback
def colored_str_by_color_code(s, color_code):
res = "\033["
res += f"{color_code}m{s}"
res += "\033[0m"
return res
class test:
""" A decorator that runs tests automatically and provides teard... | StarcoderdataPython |
8198436 | import os
import numpy as np
import torch
from torch.utils.data import DataLoader
import argparse
#from tqdm import tqdm
from dataset import ClassifierDataset
parser = argparse.ArgumentParser(description="Calculate mean and std of dataset")
parser.add_argument("path", help="Path to dataset")
args = parser.parse_args(... | StarcoderdataPython |
8028997 | import os
import numpy as np
import tensorflow as tf
from .. import summary
from .. import layers
from .. import train
from .base_model import BaseModel
class AutoencoderModel(BaseModel):
def __init__(self, name, shape, code_size):
super(AutoencoderModel, self).__init__(name)
self._shape = shap... | StarcoderdataPython |
11216993 | from django.contrib import admin
from .models import Contactos, HorariosContactos
admin.site.register(Contactos)
admin.site.register(HorariosContactos)
| StarcoderdataPython |
120685 | import re
from functools import partial
from pathlib import Path
from typing import Callable, Pattern
import requests
YT_KEY_FILENAME = 'youtube_data_api.key'
yt_key_path: Path = Path(__file__).resolve().parent / YT_KEY_FILENAME
if yt_key_path.exists():
YT_API_KEY = yt_key_path.read_text().strip()
else:
rais... | StarcoderdataPython |
1944106 | <reponame>GrahamHagenPeter/iolite4-python-examples
#/ Type: DRS
#/ Name: Sr Isotopes (Combined)
#/ Authors: <NAME>, <NAME> and author(s) of Sr_isotopes_Total_NIGL.ipf
#/ Description: A Sr isotopes DRS that corrects for REE and CaAr interferences
#/ References: None
#/ Version: 1.0
#/ Contact: <EMAIL>
from ioli... | StarcoderdataPython |
5056963 | <reponame>jaewrek/MovieWebsite<gh_stars>0
# Video class, parent to Movie class
# Constructor takes in Title and Duration of video object.
class Video():
#def __doc__(self):
#return "Video class, parent to movie and tv_show. Contains title and duration of video"
def __init__(self, title, duration):
self.title = ti... | StarcoderdataPython |
3447185 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from .evolver import Evolver
from pymongo.collection import ReturnDocument
log = logging.getLogger('tgext.evolve')
class MingEvolver(Evolver):
def _get_session(self):
return self._model.DBSession._get().impl
@property
def _co... | StarcoderdataPython |
11326092 | <gh_stars>10-100
from sqlalchemy.schema import FetchedValue
from flask_restplus import marshal
from app.extensions import db
from app.api.utils.models_mixins import AuditMixin, Base
class NOWApplicationDocumentSubType(AuditMixin, Base):
__tablename__ = 'now_application_document_sub_type'
now_application_docu... | StarcoderdataPython |
200161 | import sys
input = sys.stdin.readline
a, b, c = map(int, input().split())
match = [a, b, c]
cnt = 0
for i in range(3):
if match[i] == 5:
cnt += 2
elif match[i] == 7:
cnt += 1
if cnt == 5:
ans = 'YES'
else:
ans = 'NO'
print(ans)
| StarcoderdataPython |
8118326 | __author__="mcanuto"
__date__ ="$Feb 13, 2014 6:11:42 PM$"
#from subprocess import call, Popen
import subprocess
import re
import gmetric
import threading
from gmetric import GmetricConf
from time import sleep
from logging import handlers
import logging
import os
logger = logging.getLogger(__name__)
logger.setLevel(l... | StarcoderdataPython |
9670134 | import importlib
from glob import glob
module_names = glob('./models/*.py')
for module_name in module_names:
name = module_name.split('/')[-1].split('.')[0]
if name == '__init__':
continue
importlib.import_module('models.' + name)
| StarcoderdataPython |
1991029 | import ldap,pprint
from ldap.controls import BooleanControl
ldap_uri = "ldap://172.16.15.10"
dn = "CN=<NAME>,CN=Users,DC=dom2,DC=adtest,DC=local"
password = '<PASSWORD>'
trace_level = 2
LDAP_SERVER_DOMAIN_SCOPE_OID='1.2.840.113556.1.4.1339'
l = ldap.initialize(ldap_uri,trace_level=trace_level)
# Switch off chasing ... | StarcoderdataPython |
3378389 | <gh_stars>0
from contextlib import contextmanager
from annotypes import TYPE_CHECKING
from .serializable import serialize_object
from .loggable import Loggable
from .request import Subscribe, Unsubscribe
from .response import Response
from .concurrency import RLock
if TYPE_CHECKING:
from .models import BlockMode... | StarcoderdataPython |
5192495 | <filename>feed/log.py
def log(being, action, detail):
print "<{}> [{}] {}".format(being.name, action, detail)
| StarcoderdataPython |
4849158 | class TestCatalog:
...
| StarcoderdataPython |
44190 | """
Readout __init__.
"""
try:
from spikey.snn.readout.threshold import Threshold
from spikey.snn.readout.neuron_rates import NeuronRates
from spikey.snn.readout.population_vector import PopulationVector
from spikey.snn.readout.topaction import TopAction
except ImportError as e:
raise ImportError(f"... | StarcoderdataPython |
397451 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 <NAME> <EMAIL>
#
import logging
import numbers
import sys
from haystack.outputters import Outputter
from haystack import types
from haystack import basicmodel
log = logging.getLogger('python')
class PythonOutputter(Outputter):
""" Parse a s... | StarcoderdataPython |
11275679 | <filename>test/test_satellite_image_loader.py
"""
Copyright © 2020 Uncharted Software Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... | StarcoderdataPython |
5566 | <gh_stars>1-10
# For @UniBorg
# courtesy <NAME>
"""Self Destruct Plugin
.sd <time in seconds> <text>
"""
import time
from userbot import CMD_HELP
from telethon.errors import rpcbaseerrors
from userbot.utils import admin_cmd
import importlib.util
@borg.on(admin_cmd(pattern="sdm", outgoing=True))
async def selfdestr... | StarcoderdataPython |
9656592 | <gh_stars>1-10
from lib_can import CAN, UBYTE_ARRAY
import math
class Vehicle(object):
"""
Class for the vehicle model and vehicle control
"""
def __init__(self, wheel_base, width, length, can):
"""
Init
Parameters:
wheel_base
width
... | StarcoderdataPython |
1957662 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
sbpy Activity: Dust
===================
All things dust coma related.
"""
__all__ = [
'phase_HalleyMarcus',
'Afrho',
'Efrho'
]
from warnings import warn
import abc
import numpy as np
import astropy.units as u
from .. import bib
from... | StarcoderdataPython |
6504315 | <gh_stars>0
import logging
from typing import (
cast,
Tuple,
)
from eth.rlp.headers import (
BlockHeader,
)
from eth.tools.logging import (
ExtendedDebugLogger,
)
from eth_typing import (
BlockIdentifier,
Hash32,
)
from lahja import (
BroadcastConfig,
EndpointAPI,
)
from p2p.abc import ... | StarcoderdataPython |
3247596 | import torch
import torch.nn as nn
import torch.nn.functional as F
#from model.grad_reverse import grad_reverse
###############################################################################
#
# PhiGnetwork retuns u = phi(G(x)) where
#
# x = image
# z = G(x) = exactly Feature() in MCD-DA
# u = phi(z) = the la... | StarcoderdataPython |
8082282 | <reponame>aqifcse/django-coding-task
# Generated by Django 3.2.8 on 2021-11-01 08:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0002_product_productvariant_productvariantprice'),
]
operations = [... | StarcoderdataPython |
11398854 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""Hardware Types [:rfc:`826`][:rfc:`5494`]"""
from aenum import IntEnum, extend_enum
__all__ = ['Hardware']
class Hardware(IntEnum):
"""[Hardware] Hardware Types [:rfc:`826`][:rfc:`5494`]"""
#: Reserved [:rfc:`5494`]
Reserved_0 = 0... | StarcoderdataPython |
3384857 | class FacetingUtils(object):
"""
This class is used to convertTrianglesToQuads a triangulated structure into a structure in which some of the triangles
have been consolidated into quadrilaterals.
"""
@staticmethod
def ConvertTrianglesToQuads(triangulation):
"""
ConvertTrianglesTo... | StarcoderdataPython |
3302995 | # ===========================================================================
# imagetools.py -----------------------------------------------------------
# ===========================================================================
# import ------------------------------------------------------------------
# -----... | StarcoderdataPython |
1737094 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging
import onnx.backend.test
from tests_compatibility import (
BACKEND_NAME,
skip_rng_tests,
xfail_issue_33488,
xfail_issue_33581,
xfail_issue_33589,
xfail_issue_33595,
xfail_issue_33596,
xfail... | StarcoderdataPython |
1838439 | <reponame>louisleroy5/archetypal
"""EnergyPlus variables module."""
import pandas as pd
from geomeppy.patches import EpBunch
from archetypal.energypandas import EnergyDataFrame
from archetypal.reportdata import ReportData
class Variable:
def __init__(self, idf, variable: (dict or EpBunch)):
"""Initializ... | StarcoderdataPython |
3256256 | <reponame>Wordseer/wordseer
"""Blueprint for the uploader.
The uploader handles creation and deletion of files and projects, as well as
sending them to the processing pipeline.
"""
import os
from flask import Blueprint
static_url = os.path.dirname(__file__)#Problem with this static absolute path. changed to relativ... | StarcoderdataPython |
29339 | #!/usr/bin/python
# Copyright 2021 Northern.tech AS
#
# 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 ap... | StarcoderdataPython |
4901693 | import platform
import textwrap
import pytest
import six
from conans.test.utils.tools import TestClient
@pytest.mark.tool_apt_get
@pytest.mark.skipif(platform.system() != "Linux", reason="Requires apt")
@pytest.mark.skipif(six.PY2, reason="Does not pass on Py2 with Pytest")
def test_apt_check():
client = TestCl... | StarcoderdataPython |
9661304 | <filename>twitch/helix/resources/follows.py
from typing import List, Optional
import twitch.helix as helix
from twitch.api import API
from .resource import Resource
class Follows(Resource['helix.Follow']):
FOLLOWING: int = 1
FOLLOWED: int = 2
def __init__(self, api: API, follow_type: 1, **kwargs: Option... | StarcoderdataPython |
169553 | # Copyright (c) 2013-2015 Centre for Advanced Internet Architectures,
# Swinburne University of Technology. All rights reserved.
#
# Author: <NAME> (<EMAIL>)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redist... | StarcoderdataPython |
210718 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=200)
attribute = models.CharField(max_length=12)
project = models.CharField(max_length=32,default ="")
project_id = models.CharField(max_length=12... | StarcoderdataPython |
9624270 | # Replace the default logging configuration with a custom one
from astropy.logger import logging
log = logging.getLogger('SDTmonitor')
log.propagate = False
sh = logging.StreamHandler()
f = logging.Formatter('%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
sh.setFormatter(f)
log.addHandler(sh)
log.setLevel(log... | StarcoderdataPython |
1701460 | from torch.nn.modules.loss import NLLLoss
class WeightedBinaryCrossEntropyLoss(NLLLoss):
r"""The WeightedBinaryCrossEntropyLoss loss. It is useful to train a binary output maps.
Documentation and implementation based on pytorch BCEWithLogitsLoss.
If provided, the optional argument :attr:`weight` will bal... | StarcoderdataPython |
8171374 | from collections import OrderedDict
import math
from auto_ml import utils
import pandas as pd
from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier
from sklearn.metrics import mean_squared_error, make_scorer, brier_score_loss, accuracy_score, explained_variance_score, mean_absolute_error, ... | StarcoderdataPython |
6629026 | <gh_stars>1-10
from __future__ import absolute_import
from eth_utils import (
is_string,
)
from populus.utils.module_loading import (
import_string,
)
from populus.config.helpers import (
ClassImportPath,
)
from .base import Config
BACKEND_IDENTIFIER_MAP = {
'solc:combined-json': 'populus.compilati... | StarcoderdataPython |
8006993 | <reponame>MarvinT/ponyo
"""
Author: <NAME>
Date Created: 30 August 2019
These scripts generate simulated compendia using the low-dimensional
representation of the gene expressiond data, created by training the
VAE on gene expression data.
"""
import os
import pandas as pd
import numpy as np
import glob
import warning... | StarcoderdataPython |
111411 | with open("input_9.txt", "r") as f:
lines = f.readlines()
nums = [int(line.strip()) for line in lines]
# for i, num in enumerate(nums[25:]):
# preamble = set(nums[i:25 + i])
# found_pair = False
# for prenum in preamble:
# diff = num - prenum
# if diff in preamble:
# found_p... | StarcoderdataPython |
5095223 | import logging
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import EmailMessage
from django.db.models... | StarcoderdataPython |
174271 | from DCWorkflowGraph import getGraph
from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
import os
# Import "MessageFactory" to create messages in the DCWorkflowGraph domain
from zope.i18nmessageid import MessageFactory
_ = MessageFactory... | StarcoderdataPython |
3567300 | import torch
import torch.nn as nn
import torch.nn.functional as F
from model import Model
from .loss_coral import coral_loss
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
def convert_pred_to_pseudo_parallel(targets_u, converter):
blank = converter.dict[' ']
unl_N, unl_len = targets_... | StarcoderdataPython |
376436 | <reponame>shubhamjha97/rlkit<filename>RLkit/environment.py<gh_stars>1-10
import gym
class Environment:
def __init__(self, env_name, render=False):
self.env = gym.make(env_name)
self.render = render
self.timestep = 0
self.done = False
self.reset()
def reset(self):
observation = self.env.reset()
return ... | StarcoderdataPython |
5184599 | <reponame>KhanhThiVo/SimuRLacra<gh_stars>0
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are m... | StarcoderdataPython |
11949 | <gh_stars>0
# -*- coding: utf-8 -*-
from nltk.parse import DependencyGraph
from collections import defaultdict
import random
import sys
import copy
from json import dumps
from pprint import pprint
try:
from .lg_graph import LgGraph
except:
sys.path.append("/Users/tdong/git/lg-flask/tasks/lgutil")
from .lg_... | StarcoderdataPython |
8109221 | # Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Defines external Haskell dependencies.
#
# Add Stackage dependencies to the `packages` attribute of the `@stackage`
# `stack_snapshot` in the very bottom of this file. If a package ... | StarcoderdataPython |
1693586 | <gh_stars>1-10
# -*- coding: utf-8 -*-
###############################################################################
#
# Person
# Returns members of Congress and U.S. Presidents since the founding of the nation.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, ... | StarcoderdataPython |
3242575 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import argparse
import sys
import numpy as np
import torch
import torch.optim as optim
from tqdm import tqdm
from network.BEV_Unet import BEV_Unet
from network.ptBEV import ptBEVnet
from dataloader.dataset import collate_fn_BEV,SemKITTI,SemKITTI_labe... | StarcoderdataPython |
3477343 | <reponame>GettingGodlyInThisGame/scrapewhitepages
import requests, re
from pymongo import MongoClient
from bs4 import BeautifulSoup
from HTMLParser import HTMLParser
searchterm = 'johnson'
client = MongoClient('localhost', 27017)
db = client['whitepages']
collection = db['scraped']
class MLStripper(HTMLParser):
d... | StarcoderdataPython |
335733 | <reponame>gecko-robotics/pygecko
#!/usr/bin/env python
from __future__ import print_function
from pygecko import Record
import argparse
def handleArgs():
parser = argparse.ArgumentParser(description="""
A simple zero MQ message tool. It will either publish messages on a specified
topic or subscribe to a topic and... | StarcoderdataPython |
1806077 | '''
Originally from https://github.com/rwestberg/lldbscripts
'''
import lldb
import threading
SIGILL_NUM = 4
class ProcessEventListener(threading.Thread):
def __init__(self, debugger):
super(ProcessEventListener, self).__init__()
self._listener = debugger.GetListener()
self._debugger = debu... | StarcoderdataPython |
5043813 | import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
import covid_dashboard
### test to see if update_data adds items to the queue
def test_update_data():
a,b,c,d ... | StarcoderdataPython |
8177654 | <reponame>sudoguy/django-herald<filename>herald/base.py
"""
Base notification classes
"""
import json
from email.mime.base import MIMEBase
from mimetypes import guess_type
import jsonpickle
import re
import six
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import... | StarcoderdataPython |
5045273 | <reponame>Every-Developer/InstagramBot
# InstaBot!(Request remover) v12.1
# Programmer : Mohammadreza.D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
# Python Version : 3.9.9
# Selenium Version : 4.0.0
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
# Developer name : *_* Every Developer *_*... | StarcoderdataPython |
74525 | from abc import ABC, abstractmethod
import gym
class BaseGymEnvironment(gym.Env):
"""Base class for all Gym environments."""
@property
def parameters(self):
"""Return environment parameters."""
return {
'id': self.spec.id,
}
class EnvBinarySuccessMixin(ABC):
"""... | StarcoderdataPython |
364978 | <gh_stars>0
# voximplant settings
VOX_ACCOUNT_ID = ''
VOX_API_KEY = ''
| StarcoderdataPython |
12811396 | # coding=utf-8
import hashlib
import json
import time
import requests
from enum import Enum
from .key import get_xpub, get_child_xpub, get_seed, get_child_xprv, get_root_xprv, xprv_sign
from .key import get_entropy, get_mnemonic
from .receiver import get_main_vapor_address, get_public_key
from .segwit_addr import deco... | StarcoderdataPython |
1792013 | import pandas as pd
import os
from time import ctime
dataset = "camcan"
if os.path.exists("/home/parietal/"):
results_path = "/home/parietal/hjanati/csvs/%s/" % dataset
else:
data_path = "~/Dropbox/neuro_transport/code/mtw_experiments/meg/"
data_path = os.path.expanduser(data_path)
results_path = data... | StarcoderdataPython |
6573477 | import unittest
import timeout_decorator
from gradescope_utils.autograder_utils.decorators import weight
import numpy as np
import os
from manipulation import FindResource
class TestPoseEstimation(unittest.TestCase):
def __init__(self, test_name, notebook_locals):
super().__init__(test_name)
sel... | StarcoderdataPython |
8049324 | from tkinter import *
from tkinter import ttk
import numpy as np
import io
import base64
from PIL import ImageTk, Image
import requests
import os
import matplotlib
from matplotlib import image as mpimg
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
url = "http://vcm-9111.vm.duke.edu:5000/"
# url = "ht... | StarcoderdataPython |
3410599 | <gh_stars>1-10
#!/usr/bin/env python
import string, re
from DOM import Element, Text, Node, DocumentFragment, Document
from Tokenizer import Token, BeginGroup, EndGroup, Other
from plasTeX import Logging
log = Logging.getLogger()
status = Logging.getLogger('status')
deflog = Logging.getLogger('parse.definitions')
#
... | StarcoderdataPython |
9612480 | <filename>Algorithms/Search/Ice_Cream_Parlor/main.py<gh_stars>0
### Ice Cream Parlor - Solution
def icecreamParlor(m, arr):
indexes = []
for i in range(len(arr)-1):
for j in range(i+1, len(arr)):
if arr[i]+arr[j] == m:
indexes.append(i+1)
indexes.append(j+1)
... | StarcoderdataPython |
231065 | <gh_stars>0
#Filesystem imports for functions:
from difflib import context_diff
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.station import inconsistent_typical_range_stations
from floodsystem.flood import risk_asse... | StarcoderdataPython |
3390572 | # coding: utf-8
from getsub.main import GetSubtitles
def get_function(
func,
name="",
query=False,
single=False,
more=False,
both=False,
over=False,
plex=False,
debug=False,
sub_num=1,
downloader=None,
sub_path="",
):
obj = GetSubtitles(
name,
query... | StarcoderdataPython |
8133704 | <reponame>The-Repo-Depot/qark
from __future__ import absolute_import
'''Copyright 2015 LinkedIn Corp. 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
Un... | StarcoderdataPython |
12801625 | # -*- coding: utf-8 -*-
# Copyright (2018) Hewlett Packard Enterprise Development LP
#
# 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... | StarcoderdataPython |
1845396 | import yaml
from .module_resources import ModuleResource
LOADER = yaml.SafeLoader
def namedtuple_constructor(loader, node):
mapping = loader.construct_mapping(node)
yield ModuleResource.mapping_to_namedtuple(mapping, loader.spec, 'yaml')
yaml.add_constructor('tag:yaml.org,2002:map', namedtuple_constructor,... | StarcoderdataPython |
11306431 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
File : flask_manage.py
Author : <NAME>
CreateDate : 2018-12-28 10:00:00
LastModifiedDate : 2018-12-28 10:00:00
Note : 拉起HTTP服务入口
"""
from src.restfuls.apps import create_app
if __name__ == '__main__':
_HOST = '0.0.0.0'
_PORT = 5000
flask_server = create_app()... | StarcoderdataPython |
3349262 | <gh_stars>0
from django.conf import settings
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext_lazy as _
from oscar.core.application import OscarConfig
from oscar.core.loading import get_class
class CheckoutConfig(OscarCon... | StarcoderdataPython |
4930942 | <gh_stars>0
from os import environ
from sys import argv
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
SECRET_KEY = environ['DJANGO_SECRET_KEY']
ALLOWED_HOSTS = environ.get(
'DJANGO_ALLOWED_HOSTS', 'simone.xormedia.com'
).spl... | StarcoderdataPython |
1937486 |
# Part One:
# Starting with a frequency of zero, what is the resulting frequency
# after all of the changes in frequency have been applied?
input = open('input/input01.txt').readlines()
int_list = [int(x.strip()) for x in input]
print('Solution 1.1: ', sum(int_list))
# Part Two:
# You notice that the device repeats... | StarcoderdataPython |
8004582 | # Copyright (C)
# Honda Research Institute Europe GmbH
# Carl-Legien-Str. 30
# 63073 Offenbach/Main
# Germany
#
# UNPUBLISHED PROPRIETARY MATERIAL.
# ALL RIGHTS RESERVED.
__author__ = '<NAME>'
__maintainer__ = '<NAME>'
__email__ = '<EMAIL>'
import sys
import argparse
import os
import pandas as pd
from PyQt5.QtWidgets... | StarcoderdataPython |
166930 | <filename>manila/share/drivers/ibm/gpfs.py
# Copyright 2014 IBM Corp.
#
# 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
#
# Un... | StarcoderdataPython |
4969106 | <reponame>CovenantEyes/gunicorn<gh_stars>0
from gunicorn.config import Config
cfg = Config()
cfg.set("proxy_protocol", True)
req1 = {
"method": "GET",
"uri": uri("/stuff/here?foo=bar"),
"version": (1, 1),
"headers": [
("SERVER", "http://127.0.0.1:5984"),
("CONTENT-TYPE", "application/j... | StarcoderdataPython |
11255105 | <reponame>SouthwestCCDC/2019-pcc
import sys
import logging
import socket
import argparse
import json
import os
import ZODB, transaction
import data_model
def degrade_step():
data_model.load_from_disk()
for id,node in data_model.fence_segments.items():
if node.state < 1.0:
print('Degrading... | StarcoderdataPython |
289355 | <reponame>bopopescu/build
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
#... | StarcoderdataPython |
9767586 | <gh_stars>0
from pathlib import Path
from tqdm import tqdm
import argparse
import librosa
import torch
import torchaudio
from pdb import set_trace as bp
import soundfile as sf
import os
import json
import math
import os
from pathlib import Path
from tempfile import NamedTemporaryFile
import torch.nn as nn
import so... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.