id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
5017210 | import constants
from collections import Counter, deque, defaultdict, OrderedDict
from tqdm import tqdm_notebook as tqdm
import pandas as pd
import datetime
import numpy as np
import abc
import heapq
class CacheAlgorithm(abc.ABC):
@abc.abstractmethod
def run_algorithm(self, blocktrace):
pass
@abc... | StarcoderdataPython |
259885 | <gh_stars>1-10
from ai.ai_brain import AI_Brain
from ai.ai_player import AI_Player
from ai.sensor import sense_n_dir
from nn.neural_network import Neural_Network
import json
import os
import settings
class NN_Brain(AI_Brain):
"""
AI brain implementation that uses a neural network for making decisions.
"""
... | StarcoderdataPython |
5168450 | <filename>interface.py
# Final Project for CS410P
# By: <NAME> and <NAME>
# Date: 05/27/2019
import os
from effects import Effects
class CmdInterface():
def __init__(self):
# option values; allows for less hard coding of values
self.all, self.echo = '1', '2'
self.reverb, self.speed = '3', ... | StarcoderdataPython |
6412333 | <gh_stars>0
from pprint import pprint
from transformers import PreTrainedTokenizer
from diagnnose.config.config_dict import create_config_dict
from diagnnose.models import LanguageModel
from diagnnose.models.import_model import import_model
from diagnnose.syntax.evaluator import SyntacticEvaluator
from diagnnose.toke... | StarcoderdataPython |
1959408 | # Generated by Django 3.0.8 on 2020-07-31 18:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='lines',
name='freq',
field=m... | StarcoderdataPython |
4979726 | <reponame>sxie22/schnetpack<filename>src/schnetpack/nn/radial.py<gh_stars>0
from math import pi
import torch
import torch.nn as nn
__all__ = ["gaussian_rbf", "GaussianRBF", "GaussianRBFCentered", "BesselRBF"]
from torch import nn as nn
def gaussian_rbf(inputs: torch.Tensor, offsets: torch.Tensor, widths: torch.Ten... | StarcoderdataPython |
198439 | <filename>custom_components/sleep_as_android/const.py
import voluptuous as vol
DOMAIN = "sleep_as_android"
DEVICE_MACRO: str = "%%%device%%%"
DEFAULT_NAME = "SleepAsAndroid"
DEFAULT_TOPIC_TEMPLATE = "SleepAsAndroid/%s" % DEVICE_MACRO
DEFAULT_QOS = 0
| StarcoderdataPython |
8032193 | from thefuzz import fuzz, process
from datetime import datetime
# niekoniecznie na roznych pietrach te same urzadzenia maja takie same swiatla
# istnieje problem ze wlacz jest rozpoznawane czesciej jako stan OFF zamiast ON
# czasami istnieje problem ze podczas wylaczenie po
# parter: kuchnia, lazienka
# pierwsze pie... | StarcoderdataPython |
6594287 | # qos.py
# author: <NAME> <<EMAIL>>
# unit tests for the D7A SP QoS Paramters
import unittest
from d7a.sp.qos import QoS
class TestQoS(unittest.TestCase):
def test_default_constructor(self):
qos = QoS()
def test_byte_generation(self):
bytes = bytearray(QoS())
self.assertEqual(len(bytes), 1)
se... | StarcoderdataPython |
1760517 | <gh_stars>0
'''CLI extension for the ``gupload`` command.'''
import os
from cliar import set_arg_map, set_metavars, set_help, ignore
from pathlib import Path
import webbrowser
from foliant.cli import make
from foliant.cli.base import BaseCli
from foliant.config import Parser
from foliant.utils import spinner
from py... | StarcoderdataPython |
392228 | from __future__ import absolute_import
import sys
try:
import itertools.izip as zip
except ImportError:
pass
import numpy as np
import pandas as pd
from .. import util
from ..dimension import Dimension
from ..element import Element
from ..ndmapping import NdMapping, item_check, OrderedDict, sorted_context
fr... | StarcoderdataPython |
9664371 | <filename>e2e/scripts/st_file_uploader.py
# Copyright 2018-2022 Streamlit 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-2.0
#
# Unless req... | StarcoderdataPython |
124383 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'第 0009 题:一个HTML文件,找出里面的链接。'
__author__ = 'Drake-Z'
import os, re
from html.parser import HTMLParser
from html.entities import name2codepoint
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
if tag == 'a':
for (variables, ... | StarcoderdataPython |
9612982 | <filename>sandbox/src1/TCSE3-3rd-examples/src/misc/docex_epydoc.py
"""
This is an example on how to document Python modules
using doc strings interpreted by the epydoc tool.
The doc strings can make use of the the reStructuredText
format.
Paragraphs are separated by blank lines. Words in running
text can be I{emphasiz... | StarcoderdataPython |
4861134 | from rest_routes.views import (
RegisterUser,
ConfirmUserOTP,
ResendUserOTP,
LoginUser,
RefreshLoginUser,
ChangeUserPassword,
Hello,
LogUserOut,
SuspendUser,
email_otp_verify,
ResetUserPasswordOTPAPIView,
ConfirmResetUserPasswordOTPAPIView,
ResetUserPasswordOTPComplet... | StarcoderdataPython |
1692949 | config.excludes.add('driver.sv')
| StarcoderdataPython |
5044173 | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.cloudformation.checks.resource.base_resource_value_check import BaseResourceValueCheck
class CloudtrailMultiRegion(BaseResourceValueCheck):
def __init__(self):
name = "Ensure CloudTrail is enabled in all Regions"
id ... | StarcoderdataPython |
348797 | import yaml
import numpy as np
import cv2
import argparse
parser = argparse.ArgumentParser(description='Detect Cars in Image')
parser.add_argument('file', metavar='FILE', help='file path to run detection on')
parser.add_argument('fyaml', metavar='FILE', help='file path of yml')
args = parser.parse_args()
# ... | StarcoderdataPython |
5196436 | def create_client(service, account=None, role=None):
"""
Summary:
Creates the appropriate boto3 client for a particular AWS service
Args:
:type service: str
:param service: name of service at Amazon Web Services (AWS),
e.g. s3, ec2, etc
:type credentials: sts cred... | StarcoderdataPython |
392588 | # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# CORL experiment set.
from __future__ import print_function
from ...benchmark_tools.experiment i... | StarcoderdataPython |
82995 | <reponame>sujatasaini/Japanese-character-recognition-using-DropBlock<gh_stars>1-10
# Import the libraries
from keras import backend as K
from keras.datasets import mnist
from keras.layers.convolutional import Conv2D, MaxPooling2D
from keras.layers.core import Activation, Flatten, Dense
from keras.models import Sequenti... | StarcoderdataPython |
369265 | from pyspark.sql import SparkSession
from sparkxarray.reader import ncread
import os
spark = SparkSession.builder.appName('spark-tests').getOrCreate()
sc = spark.sparkContext
print(os.getcwd())
filename = os.path.abspath('sparkxarray/tests/data/air.sig995.2012.nc')
print(filename)
paths = os.path.abspath('sparkxarra... | StarcoderdataPython |
3543014 | <reponame>sdv-dev/RDT
"""Transformer for datetime data."""
import numpy as np
import pandas as pd
from rdt.transformers.base import BaseTransformer
from rdt.transformers.null import NullTransformer
class DatetimeTransformer(BaseTransformer):
"""Transformer for datetime data.
This transformer replaces dateti... | StarcoderdataPython |
1961403 | from flask import Blueprint, jsonify
from flask import request, make_response
from ..glovar import *
import traceback
from ..db import read as R
from ..db import create as C
tagBp = Blueprint("tags", __name__, url_prefix='/tags')
@tagBp.route('', methods=['GET'])
def getAllTags(**checkrst):
try:
... | StarcoderdataPython |
5066454 | <reponame>DBeath/python-snippets
class TestType:
def __init__(self, *args, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
item = TestType(name='One', value=2)
print(type(item))
print(vars(item))
| StarcoderdataPython |
3217752 | <gh_stars>0
from typing import AsyncGenerator, Tuple
import anyio
from p2pclient.libp2p_stubs.crypto.pb import crypto_pb2 as crypto_pb
from p2pclient.libp2p_stubs.peer.id import ID
from .control import DaemonConnector
from .datastructures import PeerInfo
from .exceptions import ControlFailure
from .pb import p2pd_pb2... | StarcoderdataPython |
11214625 | ###################################################################
# ABOUT:
# This Python script gets data from the Pipeline-database and
# produces plots and correlations of selected variables.
# The purpose is to study how seeing with ALFOSC
# is related to various variables e.g. wind and temperature.
#
... | StarcoderdataPython |
6434626 | # -*- coding: utf-8 -*-
"""
raas_v2.models.reward_model
This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io )
"""
import raas_v2.models.reward_credential_model
class RewardModel(object):
"""Implementation of the 'Reward' model.
Reward Model... | StarcoderdataPython |
9644937 | <gh_stars>1-10
# Generated by Django 2.1.5 on 2019-03-29 20:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('database', '0002_log'),
]
operations = [
migrations.CreateModel(
name='Occupy',
... | StarcoderdataPython |
1687489 | <filename>p2ch12/model.py
import math
from torch import nn as nn
from util.logconf import logging
log = logging.getLogger(__name__)
# log.setLevel(logging.WARN)
# log.setLevel(logging.INFO)
log.setLevel(logging.DEBUG)
class LunaModel(nn.Module):
def __init__(self, in_channels=1, conv_channels=8):
super... | StarcoderdataPython |
6474644 | <gh_stars>1-10
"""Tools for generating UUIDs."""
def suuid() -> str:
"""
Generate a string UUID (universally unique identifier).
Uses the UUID4 specification.
Returns
-------
str
A UUID.
"""
from uuid import uuid4
return str(uuid4())
| StarcoderdataPython |
9642893 | <reponame>pzarabadip/thermof<filename>thermof/trajectory/tools.py
# Date: August 2017
# Author: <NAME>
"""
Mean squared displacement calculation for Lammps trajectory.
"""
import numpy as np
import periodictable
def center_of_mass(atoms, coordinates):
""" Calculate center of mass for given coordinates and atom na... | StarcoderdataPython |
9751156 | <reponame>aikige/qr_with_logo
#!/usr/bin/env python
import qrcode
from PIL import Image, ImageDraw
def encode_qr_with_logo(body, logo_filename, output_filename, transparent=False, size=0, version=None, bg_color='white', fg_color='black'):
qr = qrcode.QRCode(
version=version,
error_correcti... | StarcoderdataPython |
6557135 | #!/usr/bin/env python3
# imports go here
#
# Free Coding session for 2015-06-17
# Written by <NAME>
#
class Hi(object):
def __init__(self, name):
self.name = name
import threading
class Runner(threading.Thread):
def __init__(self):
super(Runner, self).__init__()
self.hi = Hi("Matt")
... | StarcoderdataPython |
6473807 | <filename>tests/test_songdata.py<gh_stars>1-10
from datetime import datetime
from enum import Enum
import pytest
from music_metadata_extractor import SongData
class Expected(Enum):
PASS = 1
NO_METADATA_FOUND = 2 # See if we can convert these to PASS
UNSUPPORTED_LINK = 3 # Support these links if possibl... | StarcoderdataPython |
4880118 | <filename>multiLevelCoSurrogates/utils/__init__.py
from .pathing import *
from .plotting import *
from .sampling import *
from .scaling import *
| StarcoderdataPython |
3529245 | # Generated by Django 2.1.7 on 2019-03-12 01:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0017_auto_20190220_0013'),
]
operations = [
migrations.RemoveField(
model_name='guest',
name='allergies',
... | StarcoderdataPython |
3468957 | <filename>scripts/docs.py<gh_stars>1-10
'''Generate documentation for certain Canister.py methods.'''
# docs.py
# imports
import canisterpy as cpy
from inspect import (
isclass, isfunction, iscoroutinefunction
)
def normalize(tn: str): return tn.replace(' ', ' ')
def doc(td: object):
if isclass(td)... | StarcoderdataPython |
1812439 | <filename>metadata-ingestion/src/datahub/ingestion/source/s3/config.py
import logging
import os
import re
from typing import Any, Dict, List, Optional, Union
import parse
import pydantic
from wcmatch import pathlib
from datahub.configuration.common import AllowDenyPattern, ConfigModel
from datahub.emitter.mce_builder... | StarcoderdataPython |
1924929 | <reponame>morgangiraud/PySyft<gh_stars>1-10
""" Based upon https://github.com/keras-team/keras/blob/master/keras/metrics.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import six
import math
def cosine_similarity(v1,v2):
"comp... | StarcoderdataPython |
5123493 | import datetime
import json
import pandas as pd
import pytest
from python_etl import transform_data
@pytest.fixture()
def base_jh_data():
base_jh_data_dict = {
"Date": ["2020-01-22", "2020-01-22", "2020-01-23", "2020-01-24"],
"Country/Region": ["UK", "US", "US", "US"],
"Province/State": ["... | StarcoderdataPython |
11200342 | <reponame>Wenzurk-Ma/Python-Crash-Course<filename>Chapter 05/ages.py
# Title : TODO
# Objective : TODO
# Created by: Wenzurk
# Created on: 2018/2/6
age = 21
if age < 2:
print("She is a baby.")
elif age < 4:
print("She is a child.")
elif age < 13:
print("She is a little girl.")
elif age < 20:
print... | StarcoderdataPython |
8117060 | import datetime
import logging
import os
import requests
import time
from perylune.tle import tle
from orbit_predictor.sources import NoradTLESource
from orbit_predictor.predictors.base import Predictor
from perylune.conf import Config, getConfig, APP_NAME, VERSION
from perylune.utils import url_to_filename
CELESTRA... | StarcoderdataPython |
248769 | <reponame>xyrise/recontext
import json
import requests
from Document import Document
class SemanticScholar:
def __init__(self):
self.query_url = 'https://api.semanticscholar.org/graph/v1/paper/search?'
def queryURL(self, keywords, start_results, max_results, fields):
if len(keywords) < 1: re... | StarcoderdataPython |
3320588 | <filename>src/attack_surface_pypy/core/exceptions/parse.py
from attack_surface_pypy.core import exceptions
class InvalidFileDataError(exceptions.BaseError):
_template = "Unable to parse data at %s"
def __init__(self, message: str) -> None:
super().__init__(self._template % message)
| StarcoderdataPython |
5013990 | from typing import List
from raytracer.tuple import tuple
from raytracer.util import equal
class Matrix:
def __init__(self, data: List[List]):
self.data = data
self.cached_inverse = None
self.cached_transpose = None
def __getitem__(self, key):
r, c = key
return self.d... | StarcoderdataPython |
5119716 | from src.app import application
if __name__ == '__main__':
application.run(debug=True, port=5000, host='0.0.0.0') | StarcoderdataPython |
1883160 | <reponame>waab76/WerewolfBot
'''
Created on Feb 22, 2021
@author: rcurtis
'''
import gspread
import logging
from oauth2client.service_account import ServiceAccountCredentials
class MySheet(object):
sheet = None
vote_sheet = None
action_sheet = None
role_sheet = None
codewords = None
... | StarcoderdataPython |
8104091 | <reponame>jeanbez/spack
# Copyright 2013-2022 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.package import *
class PyYtoptAutotune(PythonPackage):
"""Common interface for au... | StarcoderdataPython |
6663470 | <filename>tests/urls.py
from django.urls import path, include
from django.contrib import admin
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('emailuser.urls'), name='accounts'),
] | StarcoderdataPython |
9661305 | """
ImageParser.py
Created by SharpDevelop.
User: Stonepaw
"""
import re
import clr
import common
import System
clr.AddReference('System.Net')
import System.Net
clr.AddReference("System.Xml")
from System.Xml import XmlDocument
clr.AddReference("HtmlAgilityPack")
import HtmlAgilityPack
clr.AddReference("System.Wind... | StarcoderdataPython |
11379208 | from setuptools import setup, find_packages
setup(name='gym-pool',
version='0.1.32',
url='https://github.com/to314as/gym-pool',
author='<NAME>',
author_email='<EMAIL>',
package_dir={"": "."},
packages=find_packages(),
install_requires=['gym>=0.2.3',
'n... | StarcoderdataPython |
6568786 |
# This file was generated automatically by generate_protocols.py
from nintendo.nex import notification, rmc, common, streams
import logging
logger = logging.getLogger(__name__)
class RankingOrderCalc:
STANDARD = 0
ORDINAL = 1
class RankingMode:
GLOBAL = 0
GLOBAL_AROUND_SELF = 1
SELF = 4
class RankingStatF... | StarcoderdataPython |
233871 | <reponame>kordikp/AutoMLprediction<filename>implementation/h2o-benchmarker/Benchmarker/model_config.py
import yaml
import sklearn.grid_search as grid
import datetime
import pandas as pd
import config
import numpy as np
import numbers
import re
import h2o
from utils import persist
def appendVal(row, lmbda):
... | StarcoderdataPython |
8005629 | import nexmo
from models import SessionManager, groups, config
from modules import configmanager
def nexmo_message(target, message, source='FIDO'):
appid = configmanager.get_config(module='nexmo', key='appid')[0]
secret = configmanager.get_config(module='nexmo', key='secret')[0]
client = nexmo.Client(key=... | StarcoderdataPython |
12804599 | <reponame>mdop-wh/pulumi-aws
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional,... | StarcoderdataPython |
6587025 | <filename>leetcode/offer_40.py
class Solution:
def getLeastNumbers(self, arr: List[int], k: int) -> List[int]:
arr.sort()
return arr[:k]
| StarcoderdataPython |
1629514 | <reponame>alexeyev/visartm<filename>tools/urls.py
from django.conf.urls import url
import tools.views as tools_views
urlpatterns = [
url(r'^$', tools_views.tools_list),
url(r'^vw2uci', tools_views.vw2uci),
url(r'^uci2vw', tools_views.uci2vw),
url(r'^vkloader', tools_views.vkloader),
]
| StarcoderdataPython |
368187 | import os, urlparse
from datetime import datetime
from rauth import OAuth1Service
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views import generic
from django.contrib import messages
from djang... | StarcoderdataPython |
210945 | <filename>pycqed/instrument_drivers/physical_instruments/ZurichInstruments/UHFQuantumController.py
"""
To do:
- split off application dependent code, as done for ZI_HDAWG8.py
Notes:
Changelog:
20190113 WJV
- started Changelog
- addressed many warnings identified by PyCharm
- started adding type annotations
- split ... | StarcoderdataPython |
9700437 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
#diretorios = ['A/','B/','C/','D/','E/','F/','G/','H/','I/','J/','K/','L/','M/','N/','O/','P/','R/','S/','T/','U/','V/','W/','Y/','Z/']
#diretorios = ['A/','B/','C/','D/']
#diretorios = ['E/','F/','G/','H/']
#diretorios = ['I/','J/','K/','L/']
#diretorios = ['M/','N... | StarcoderdataPython |
9618274 | <gh_stars>0
"""
Advent of Code 2017
"""
data_rows = """4168 3925 858 2203 440 185 2886 160 1811 4272 4333 2180 174 157 361 1555
150 111 188 130 98 673 408 632 771 585 191 92 622 158 537 142
5785 5174 1304 3369 3891 131 141 5781 5543 4919 478 6585 116 520 673 112
5900 173 5711 236 2920 177 3585 4735 2135 2122 5209 265... | StarcoderdataPython |
198825 | <filename>tensorflow/contrib/data/python/kernel_tests/csv_dataset_op_test.py
# Copyright 2018 The TensorFlow Authors. 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 a copy of the License at
#
#... | StarcoderdataPython |
6659052 | #!/usr/bin/env python
# NOTE: dfquantize has been replaced by dfquantize2; we therefore don't care
# about any of these tests
from __future__ import absolute_import
import os
import numpy as np
import pandas as pd
import unittest
from python import dfquantize as dfq
MOCK_IN_DIR = 'debug_in'
MOCK_OUT_DIR = 'debug_o... | StarcoderdataPython |
5113555 | <reponame>sun1638650145/classicML
import numpy as np
from classicML import _cml_precision
from classicML import CLASSICML_LOGGER
from classicML.api.models import BaseModel
from classicML.backend import get_initializer
from classicML.backend import get_optimizer
from classicML.backend import get_loss
from classicML.bac... | StarcoderdataPython |
3530505 | """Narrative API documentation."""
BEGINNING_IMAGE_NUMBER = '''
Unique identifier for the electronic or paper report. This number is used to construct
PDF URLs to the original document.
'''
CANDIDATE_ID = '''
A unique identifier assigned to each candidate registered with the FEC.
If a person runs for several offices,... | StarcoderdataPython |
1853689 | <reponame>SirJan18/neu-ro-arm
import numpy as np
import cv2
import time
import neu_ro_arm.transformation_utils as tfm
from neu_ro_arm.camera import camera_utils
from neu_ro_arm.camera.gui import GUI
from neu_ro_arm.camera.capturer import Capturer
import neu_ro_arm.constants as constants
class Camera:
CONFIG_FILE... | StarcoderdataPython |
199341 | from calc import *
from basicfunc import *
what = input('''
Choose figure:
1) Square
2) Rectangle
3) Triangle
4) Circle
5) Cuboid
6) Cube
7) Cylinder
''')
try:
what = int(what)
except ValueError:
print('You have not entered a number')
if what == 1:
s = Square(side=take_input_as_float('Enter... | StarcoderdataPython |
11334362 | """Serve error for HACS."""
# pylint: disable=broad-except
import logging
import random
import sys
import traceback
from aiohttp import web
from ...blueprints import HacsViewBase
from ...const import ERROR, ISSUE_URL
_LOGGER = logging.getLogger("custom_components.hacs..frontend")
class HacsErrorView(HacsViewBase):... | StarcoderdataPython |
196519 | from .closer import defer, listen, close | StarcoderdataPython |
9628395 | <filename>src/pipupgrade/util/types.py
# pylint: disable=E1101
# imports - compatibility imports
from pipupgrade import _compat
from pipupgrade._compat import zip, _is_python_version
# imports - standard imports
import sys
import inspect
import collections
import itertools
def merge_dict(*args):
merged =... | StarcoderdataPython |
9711512 | <filename>3rd_week/07_get_receivers_top_order.py
top_heights = [6, 9, 5, 7, 4]
#url : https://www.notion.so/3-83a14432311c401598ce3c05e3be25c4
# range(시작점, 종료지점, step)
# 0으로 초기화된 배열 생성
def get_receiver_top_orders(heights): #O(N^2)
n = len(heights)
order_arr = [0] * n
while heights: #O(N)
# 맨 마지막 값... | StarcoderdataPython |
90501 | from setuptools import setup, find_packages
setup(
name = "django-zillow-neighborhoods",
version = "0.8.0",
author = "<NAME>",
author_email = "<EMAIL>",
url = 'https://github.com/claymation/django-zillow-neighborhoods',
description = "Django app for importing and querying Zillow's neighborhood ... | StarcoderdataPython |
11378243 | import torch.nn as nn
def gaussian_glorot(module):
""" Recursively apply Gaussian Glorot initialization to all linear and convolutional layers. """
if isinstance(module, nn.Linear) or isinstance(module, nn.Conv2d):
nn.init.xavier_normal_(module.weight)
| StarcoderdataPython |
3308498 | <filename>non_gui_scripts/list_nextprojects.py
#!/usr/bin/env python3
# Python script to list the projects in an organization
import base64, json, sys
from atdumpmemex import list_memex_projects
if len(sys.argv) != 2:
print(" Usage: " + sys.argv[0] + " org_name")
sys.exit(1)
org = sys.argv[1]
json... | StarcoderdataPython |
12847057 | <reponame>alexzanderr/_core-dev
from .datetime_ import * | StarcoderdataPython |
9687893 | from unishare import create_app
def test_config():
assert not create_app().testing
assert create_app(testing=True).testing
| StarcoderdataPython |
3378737 | <gh_stars>1-10
import json
import numpy as np
import pandas as pd
def __recursive_search__(fragment):
if isinstance(fragment, dict):
names = []
for sub_name, sub_data in fragment.items():
names += __recursive_search__(sub_data)
return names
elif isinstance(frag... | StarcoderdataPython |
4983542 | #! /usr/bin/env python
"""aws methods"""
# std libs
import sys, logging
# third party
import boto
# set up logging
logger = logging.getLogger('cigarbox')
def createS3Bucket(config):
bucket_name = config['S3_BUCKET_NAME']
conn = boto.connect_s3(config['AWS_ACCESS_KEY_ID'],config['AWS_SECRET_ACCESS_KEY'])
buck... | StarcoderdataPython |
146967 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 24 23:31:29 2015
@author: lukemcculloch
"""
import numpy as np
def search(seed, xt, yt, x, y, tri, nbr ):
"""
seed = self.seed
xt,yt = the point we want to find
x,y = the poins that make up triangle element nodes
seed = self.seed
... | StarcoderdataPython |
4901967 | <filename>graphing.py
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 17:59:00 2020
@author: lodado
"""
import os
import matplotlib.pyplot as plt
def graph(X=[], Y=[], savefolder ='./', typeof='PSNR', Xlab='epoches'):
plt.figure()
plt.title('graph')
coloring = ''
if(typeo... | StarcoderdataPython |
1824326 | import json
import logging
import os
import sys
from math import floor
from pathlib import Path
from pathlib import PurePath
import boto3
import dask
import distributed
import numpy as np
import openpyxl
import parallel_functions
import psutil
import rasterio
import rioxarray
import xarray as xr
from dask.distributed ... | StarcoderdataPython |
3409192 | <gh_stars>0
# ******************************************************************************
#
# django-loader, a configuration and secret loader for Django
#
# Copyright (C) 2021 <NAME> <<EMAIL>>.
#
# SPDX-License-Identifier: MIT
#
# ******************************************************************************
#
"""s... | StarcoderdataPython |
9712950 | <filename>histogram.py
#!/usr/bin/env python2.7
import fileinput, numpy, sys, argparse
from collections import Counter
parser = argparse.ArgumentParser(description='Generates histogram bins from numerical data.',
formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False,
epilog= '''Bin definitions are... | StarcoderdataPython |
9733399 | import sqlite3
class Database:
"""
Database will talk with the database.
All the interaction with it, the SQL code and the transaction to disk
should be here.
"""
def __init__(self, path):
self.path = path
self.conn = sqlite3.connect(path)
def init(self):
"""
... | StarcoderdataPython |
1898121 | <filename>pose_tracking/cubemos_wrapper.py
#!/usr/bin/env python
# Title :loader.py
# Author :<NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# Copyright :"Copyright 2020, Proxemo project"
# Version :1.0
# License :"MIT"
# Maintainer :<NAME>, <NAME>
# Email :<EMAIL>, <EMAI... | StarcoderdataPython |
9717706 | """Parser for command line arguments."""
from __future__ import absolute_import
import collections
import os
import os.path
import datetime
import optparse
from . import config as _config
from . import utils
from .. import resmokeconfig
ResmokeConfig = collections.namedtuple(
"ResmokeConfig",
["list_suites... | StarcoderdataPython |
180679 | <filename>config/solvers.py<gh_stars>1-10
SOLVERS = (
{
'type': 'local',
'name': 'leo3',
'pretty-name': 'Leo III',
'version': '1.4',
'command': 'leo3 %s -t %d',
},
{
'type': 'local',
'name': 'cvc4',
'command': 'cvc4 --output-lang tptp --p... | StarcoderdataPython |
9776193 | # @file MuStringHandler.py
# Handle basic logging by streaming into stringIO
##
# Copyright (c) 2018, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of ... | StarcoderdataPython |
1944052 |
def run(event, context):
from osbot_utils.utils.Files import Files
return 'checking python utils: {0}'.format(Files.temp_file()) | StarcoderdataPython |
1643727 | import numpy as np
import h5py
import illustris_python as il
import matplotlib.pyplot as plt
def SelectDisk(snap_num):
'''
Input Snapshot number, like snap_num = 99 (z=0)
Select disk galaxies, return haloID of them.
'''
#select halo stellar particles > 40000
with h5py.File('/Raid0/zh... | StarcoderdataPython |
8087283 | <filename>teslakit/plotting/storms.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pip
import os
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.legend import Legend
from matplotlib.patches import Circle
import matplotlib.gridspec as gridsp... | StarcoderdataPython |
6566419 | <gh_stars>10-100
import lark
from colorama import Fore, Style
from type import NType, NTypeVars, NModule, NClass
class TypeCheckError:
def __init__(self, token_or_tree, message):
if not isinstance(token_or_tree, lark.Token) and not isinstance(
token_or_tree, lark.Tree
):
ra... | StarcoderdataPython |
1726593 | '''
Script integrating detumble with orbit/magnetic field knowledge
'''
# from detumble.py_funcs import detumble_B_cross,detumble_B_dot,get_B_dot, detumble_B_dot_bang_bang
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
import numpy as np
import scipy.integrate as integrate
from orb... | StarcoderdataPython |
3588081 | <filename>symposion/speakers/forms.py
from __future__ import unicode_literals
from django import forms
from symposion.speakers.models import speaker_model
from symposion.utils.loader import object_from_settings
def speaker_form():
default = "symposion.speakers.forms.DefaultSpeakerForm"
return object_from_sett... | StarcoderdataPython |
4985202 | <gh_stars>0
from subprocess import call
from distutils import dir_util
from pathlib import Path
from argparse import ArgumentParser
from platform import system
"""
Freeze your controller into a binary executable.
Documentation: `tdw/Documentation/misc_frontend/freeze.md`
"""
if __name__ == "__main__"... | StarcoderdataPython |
1816406 | import functools
import warnings
def deprecated(deprecate_from, deprecate_to, msg):
def decorator(obj):
if isinstance(obj, type):
return _decorate_class(obj, deprecate_from, deprecate_to, msg)
# # TODO:
# elif isinstance(obj, property):
# return _decorate_prop(obj, ... | StarcoderdataPython |
140661 | from html.parser import HTMLParser
from urllib import request
import os.path
import re
import json
import sys
class ImgListScraper( HTMLParser ):
IMG_URL = "http://i.imgur.com/{hash}{ext}"
def __init__( self, *args, **kwargs ):
super().__init__( *args, **kwargs )
self.in_javascript = False
... | StarcoderdataPython |
8130568 | <reponame>TeamMolecule/petite-mort
from __future__ import print_function, division
import time
import logging
import os
import csv
import chipwhisperer as cw
from chipwhisperer.capture.scopes.cwhardware.ChipWhispererExtra import CWExtraSettings
from chipwhisperer.capture.targets.mmccapture_readers._base import MMCPac... | StarcoderdataPython |
6603678 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Queries the commercetools API, transforms data into pandas DataFrame, and
exports data to csv (purchases/orders) and xml (product catalog) files.
@author: amagrabi
"""
import pandas as pd
from lxml import etree
import config
import nr
import make_df_full
import a... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.