repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 680k |
|---|---|---|---|---|
Dagmoores/ProjetoIntegradorIUnivesp | biblioteca/views.py | 86f5004c359b760cceec87bfa905db16e3375653 | from django.views.generic import DetailView, ListView, TemplateView
from .models import Books
class BooksListView(ListView):
model = Books
class BooksDeitalView(DetailView):
model = Books
class Home(TemplateView):
template_name = './biblioteca/index.html'
class TermsOfService(TemplateView):
templat... | [] |
scwangdyd/large_vocabulary_hoi_detection | choir/evaluation/__init__.py | db7a4397c3050b1bf9a3f7473edf125e2b1046c4 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .evaluator import DatasetEvaluator, DatasetEvaluators, inference_context, inference_on_dataset
from .testing import print_csv_format, verify_results
from .hico_evaluation import HICOEvaluator
from .swig_evaluation import SWIGEvaluator
# from .d... | [] |
LHLHLHE/api_yamdb | api_yamdb/reviews/models.py | bda83815a47f3fda03d54220dfe41e9263ff1b05 | import datetime as dt
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.core.exceptions import ValidationError
from users.models import CustomUser
def validate_year(value):
"""
Год выпуска произведения не может быть больше текущего.
"""
... | [((520, 577), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(256)', 'verbose_name': '"""Название"""'}), "(max_length=256, verbose_name='Название')\n", (536, 577), False, 'from django.db import models\n'), ((589, 663), 'django.db.models.SlugField', 'models.SlugField', ([], {'max_length': '(50)',... |
matthewpruett/angr | angr/engines/pcode/arch/ArchPcode_PowerPC_LE_32_QUICC.py | bfba2af1ea2eb941001339f47a1264a685c60eec | ###
### This file was automatically generated
###
from archinfo.arch import register_arch, Endness, Register
from .common import ArchPcode
class ArchPcode_PowerPC_LE_32_QUICC(ArchPcode):
name = 'PowerPC:LE:32:QUICC'
pcode_arch = 'PowerPC:LE:32:QUICC'
description = 'PowerQUICC-III 32-bit little endian fa... | [((127376, 127465), 'archinfo.arch.register_arch', 'register_arch', (["['powerpc:le:32:quicc']", '(32)', 'Endness.LE', 'ArchPcode_PowerPC_LE_32_QUICC'], {}), "(['powerpc:le:32:quicc'], 32, Endness.LE,\n ArchPcode_PowerPC_LE_32_QUICC)\n", (127389, 127465), False, 'from archinfo.arch import register_arch, Endness, Reg... |
sieben/makesense | makesense/graph.py | 485e71903bcc9446482f21bb5d0c7a392ca1efca | # -*- coding: utf-8 -*-
import json
import pdb
import os
from os.path import join as pj
import networkx as nx
import pandas as pd
from networkx.readwrite.json_graph import node_link_data
def chain():
g = nx.Graph()
# Horizontal
for i in range(11, 15):
g.add_edge(i, i + 1)
for i in range(... | [((213, 223), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (221, 223), True, 'import networkx as nx\n'), ((1131, 1152), 'networkx.spectral_layout', 'nx.spectral_layout', (['g'], {}), '(g)\n', (1149, 1152), True, 'import networkx as nx\n'), ((1157, 1188), 'networkx.draw', 'nx.draw', (['g', 'pos'], {'node_color': '"""... |
tdiprima/code | recipes/Python/52228_Remote_control_with_telnetlib/recipe-52228.py | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | # auto_telnet.py - remote control via telnet
import os, sys, string, telnetlib
from getpass import getpass
class AutoTelnet:
def __init__(self, user_list, cmd_list, **kw):
self.host = kw.get('host', 'localhost')
self.timeout = kw.get('timeout', 600)
self.command_prompt = kw.get('command_pro... | [] |
mimbres/FFTNet | FFTNet_dilconv.py | 3a6bfb4731bab2e0a59fc3a1ddb55f19f84aeba2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 7 09:46:10 2018
@author: sungkyun
FFTNet model using 2x1 dil-conv
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# Models with Preset (for convenience)
'''
dim_input: dimension of input (256 for 8-bit mu-... | [((1832, 1959), 'torch.nn.Conv1d', 'nn.Conv1d', ([], {'in_channels': 'self.io_ch', 'out_channels': 'self.io_ch', 'kernel_size': '(2)', 'stride': '(1)', 'dilation': 'self.dilation', 'bias': 'self.bias'}), '(in_channels=self.io_ch, out_channels=self.io_ch, kernel_size=2,\n stride=1, dilation=self.dilation, bias=self.b... |
SNEWS2/snewpdag | snewpdag/plugins/Copy.py | 57f886cf08e1acd8af48ee486a1c2400e2b77b8b | """
Copy - copy fields into other (possibly new) fields
configuration:
on: list of 'alert', 'revoke', 'report', 'reset' (optional: def 'alert' only)
cp: ( (in,out), ... )
Field names take the form of dir1/dir2/dir3,
which in the payload will be data[dir1][dir2][dir3]
"""
import logging
from snewpdag.dag import N... | [] |
BuildWeek-AirBnB-Optimal-Price/application | pages/aboutus.py | c65e1ec3db309dd3afbcf9429d16489ccda534d8 | '''
houses each team member's
link to personal GitHub io or
website or blog space
RJProctor
'''
# Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
... | [((1535, 1562), 'dash_bootstrap_components.Row', 'dbc.Row', (['[column1, column2]'], {}), '([column1, column2])\n', (1542, 1562), True, 'import dash_bootstrap_components as dbc\n'), ((450, 608), 'dash_core_components.Markdown', 'dcc.Markdown', (['"""\n ## The Team: \n Select a link to learn more a... |
eyantra/FireBird_Swiss_Knife | Codes/Python32/Lib/importlib/test/extension/test_path_hook.py | cac322cf28e2d690b86ba28a75e87551e5e47988 | from importlib import _bootstrap
from . import util
import collections
import imp
import sys
import unittest
class PathHookTests(unittest.TestCase):
"""Test the path hook for extension modules."""
# XXX Should it only succeed for pre-existing directories?
# XXX Should it only work for directories contai... | [((682, 709), 'test.support.run_unittest', 'run_unittest', (['PathHookTests'], {}), '(PathHookTests)\n', (694, 709), False, 'from test.support import run_unittest\n'), ((389, 422), 'importlib._bootstrap._file_path_hook', '_bootstrap._file_path_hook', (['entry'], {}), '(entry)\n', (415, 422), False, 'from importlib impo... |
dcragusa/WeeklyPythonExerciseB2 | 3. count_words/solution.py | a7da3830e27891060dcfb0804c81f52b1f250ce8 | import os
from glob import iglob
from concurrent.futures import ThreadPoolExecutor
def count_words_file(path):
if not os.path.isfile(path):
return 0
with open(path) as file:
return sum(len(line.split()) for line in file)
def count_words_sequential(pattern):
return sum(map(count_words_fil... | [((124, 144), 'os.path.isfile', 'os.path.isfile', (['path'], {}), '(path)\n', (138, 144), False, 'import os\n'), ((387, 407), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {}), '()\n', (405, 407), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((323, 337), 'glob.iglob', 'iglob', ([... |
cirobarradov/kafka-connect-hdfs-datalab | kafka-connect-azblob/docs/autoreload.py | 7e2b23bdb78b34f9934b8d56618a8035b75f6f54 | #!/usr/bin/env python
from livereload import Server, shell
server = Server()
server.watch('*.rst', shell('make html'))
server.serve()
| [((72, 80), 'livereload.Server', 'Server', ([], {}), '()\n', (78, 80), False, 'from livereload import Server, shell\n'), ((104, 122), 'livereload.shell', 'shell', (['"""make html"""'], {}), "('make html')\n", (109, 122), False, 'from livereload import Server, shell\n')] |
atom-zh/Keras-TextClassification | keras_textclassification/conf/path_config.py | 26c549e8e23c6a10905c2dcef7eef557dc43c932 | # -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/6/5 21:04
# @author :Mo
# @function :file of path
import os
import pathlib
import sys
# 项目的根目录
path_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
path_root = path_root.replace('\\', '/')
path_top = str(pathlib.P... | [((212, 237), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (227, 237), False, 'import os\n'), ((324, 349), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (339, 349), False, 'import os\n')] |
robertopreste/apyhgnc | tests/test_apyhgnc.py | 26efa764a2262cfa12c8a2f0f077569e7f3e4e79 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Created by Roberto Preste
import pytest
import asyncio
from pandas.testing import assert_frame_equal
from apyhgnc import apyhgnc
# apyhgnc.info
def test_info_searchableFields(searchable_fields):
result = apyhgnc.info().searchableFields
assert result == searchab... | [((642, 673), 'apyhgnc.apyhgnc.fetch', 'apyhgnc.fetch', (['"""symbol"""', '"""ZNF3"""'], {}), "('symbol', 'ZNF3')\n", (655, 673), False, 'from apyhgnc import apyhgnc\n'), ((678, 726), 'pandas.testing.assert_frame_equal', 'assert_frame_equal', (['result', 'df_fetch_symbol_znf3'], {}), '(result, df_fetch_symbol_znf3)\n',... |
magnium/pybdaq | bdaq/tools/extract_enums.py | 8511cff42b7f953c105e7a78c8c62f6deb2430ec | import os.path
import argparse
from xml.etree import ElementTree as ET
class ExtractedEnum(object):
def __init__(self, tag_name, value_names):
self.tag_name = tag_name
self.value_names = value_names
def write_pxd(self, file_):
file_.write("\n ctypedef enum {}:\n".format(self.tag_n... | [] |
SebaB29/Python | Objetos/biblioteca.py | 8fe7b375e200d2a629e3ef83a2356002621267a6 | class Libro:
def __init__(self, titulo, autor):
"""..."""
self.titulo = titulo
self.autor = autor
def obtener_titulo(self):
"""..."""
return str(self.titulo)
def obtener_autor(self):
"""..."""
return str(self.autor)
class Biblioteca:
def... | [] |
Harvard-ATG/visualizing_russian_tools | parser_tool/tests/test_htmlgenerator.py | e8e5cf8c5b7eee0b6855594ad41b3ccd70a2d467 | # -*- coding: utf-8 -*-
import unittest
from xml.etree import ElementTree as ET
from parser_tool import tokenizer
from parser_tool import htmlgenerator
class TestHtmlGenerator(unittest.TestCase):
def _maketokendict(self, **kwargs):
token_text = kwargs.get("token", "")
token_dict = {
... | [((948, 986), 'parser_tool.htmlgenerator.render_token', 'htmlgenerator.render_token', (['token_dict'], {}), '(token_dict)\n', (974, 986), False, 'from parser_tool import htmlgenerator\n'), ((1600, 1638), 'parser_tool.htmlgenerator.render_token', 'htmlgenerator.render_token', (['token_dict'], {}), '(token_dict)\n', (162... |
threefoldtech/Threefold-Circles | taiga/hooks/gitlab/migrations/0002_auto_20150703_1102.py | cbc433796b25cf7af9a295af65d665a4a279e2d6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.core.files import File
def update_gitlab_system_user_photo_to_v2(apps, schema_editor):
# We get the model from the versioned app registry;
# if we directly import it, it'll be the wrong version... | [((1637, 1739), 'django.db.migrations.RunPython', 'migrations.RunPython', (['update_gitlab_system_user_photo_to_v2', 'update_gitlab_system_user_photo_to_v1'], {}), '(update_gitlab_system_user_photo_to_v2,\n update_gitlab_system_user_photo_to_v1)\n', (1657, 1739), False, 'from django.db import models, migrations\n'),... |
michalgagat/plugins_oauth | external_plugin_deps.bzl | 47cc344013bd43a4ac508c578f2d93f37a166ee6 | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps(omit_commons_codec = True):
JACKSON_VERS = "2.10.2"
maven_jar(
name = "scribejava-core",
artifact = "com.github.scribejava:scribejava-core:6.9.0",
sha1 = "ed761f450d8382f75787e8fee9ae52e7ec768747",
)
maven_j... | [] |
emiliocarcanobringas/11.-Operaciones_entero_con_float_python | 11.-Operaciones_entero_con_float_python.py | faf3bf2fae3b7a990e0d20483ac9ac219dcb7857 | # Este programa muestra la suma de dos variables, de tipo int y float
print("Este programa muestra la suma de dos variables, de tipo int y float")
print("También muestra que la variable que realiza la operación es de tipo float")
numero1 = 7
numero2 = 3.1416
sumadeambos = numero1 + numero2
print("El resultado d... | [] |
basiralab/RG-Select | main_gat.py | 074274f61667611205724c4423fc498ee4a0a9d0 | # -*- coding: utf-8 -*-
from sklearn import preprocessing
from torch.autograd import Variable
from models_gat import GAT
import os
import torch
import numpy as np
import argparse
import pickle
import sklearn.metrics as metrics
import cross_val
import time
import random
torch.manual_seed(0)
np.random.seed(0)
random.s... | [((273, 293), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (290, 293), False, 'import torch\n'), ((294, 311), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (308, 311), True, 'import numpy as np\n'), ((312, 326), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (323, 326), Fals... |
jeikabu/lumberyard | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/piexif/_dump.py | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | import copy
import numbers
import struct
from ._common import *
from ._exif import *
TIFF_HEADER_LENGTH = 8
def dump(exif_dict_original):
"""
py:function:: piexif.load(data)
Return exif as bytes.
:param dict exif: Exif data({"0th":dict, "Exif":dict, "GPS":dict, "Interop":dict, "1st":dict, "thumbn... | [((393, 426), 'copy.deepcopy', 'copy.deepcopy', (['exif_dict_original'], {}), '(exif_dict_original)\n', (406, 426), False, 'import copy\n'), ((11003, 11028), 'struct.pack', 'struct.pack', (['""">I"""', 'length'], {}), "('>I', length)\n", (11014, 11028), False, 'import struct\n'), ((11176, 11204), 'struct.pack', 'struct... |
mrahman4782/portalhoop | portal.py | 29e87ccaca5544590aa9ed20096c3628c1ab57b1 | import pygame
import random
from pygame import *
pygame.init()
width, height = 740, 500
screen = pygame.display.set_mode((width, height))
player = [pygame.transform.scale(pygame.image.load("Resources/Balljump-1(2).png"), (100,100)), pygame.t... | [((127, 140), 'pygame.init', 'pygame.init', ([], {}), '()\n', (138, 140), False, 'import pygame\n'), ((176, 216), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(width, height)'], {}), '((width, height))\n', (199, 216), False, 'import pygame\n'), ((1288, 1307), 'pygame.time.Clock', 'pygame.time.Clock', ([], {... |
tdimnet/integrations-core | datadog_cluster_agent/tests/test_datadog_cluster_agent.py | a78133a3b71a1b8377fa214d121a98647031ab06 | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from typing import Any, Dict
from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.datadog_cluster_agent import DatadogClusterAgentCheck
from datadog_checks.dev.utils import ... | [((1681, 1746), 'datadog_checks.datadog_cluster_agent.DatadogClusterAgentCheck', 'DatadogClusterAgentCheck', (['"""datadog_cluster_agent"""', '{}', '[instance]'], {}), "('datadog_cluster_agent', {}, [instance])\n", (1705, 1746), False, 'from datadog_checks.datadog_cluster_agent import DatadogClusterAgentCheck\n'), ((21... |
fameshpatel/olfactorybulb | prev_ob_models/KaplanLansner2014/plotting_and_analysis/plot_results.py | 8d7a644b4560309ef177c0590ff73ed4c2432604 | import pylab
import numpy
import sys
if (len(sys.argv) < 2):
fn = raw_input("Please enter data file to be plotted\n")
else:
fn = sys.argv[1]
data = np.loadtxt(fn)
# if the first line contains crap use skiprows=1
#data = np.loadtxt(fn, skiprows=1)
fig = pylab.figure()
ax = fig.add_subplot(111)
# if you wan... | [((265, 279), 'pylab.figure', 'pylab.figure', ([], {}), '()\n', (277, 279), False, 'import pylab\n'), ((830, 842), 'pylab.show', 'pylab.show', ([], {}), '()\n', (840, 842), False, 'import pylab\n'), ((458, 481), 'numpy.arange', 'numpy.arange', (['data.size'], {}), '(data.size)\n', (470, 481), False, 'import numpy\n')] |
ecmwf/pyeccodes | pyeccodes/defs/grib2/tables/15/3_11_table.py | dce2c72d3adcc0cb801731366be53327ce13a00b | def load(h):
return ({'abbr': 0, 'code': 0, 'title': 'There is no appended list'},
{'abbr': 1,
'code': 1,
'title': 'Numbers define number of points corresponding to full coordinate '
'circles (i.e. parallels), coordinate values on each circle are '
... | [] |
zacharyfrederick/deep_q_gaf | lib/take2/main.py | 6b712b17a6c89c1cba0d22e18fa336369c521d4e | from __future__ import division
from lib import env_config
from lib.senior_env import BetterEnvironment
from keras.optimizers import Adam
from rl.agents.dqn import DQNAgent
from rl.policy import LinearAnnealedPolicy, BoltzmannQPolicy, EpsGreedyQPolicy
from rl.memory import SequentialMemory
from lib import models
impor... | [((378, 400), 'random.choice', 'random.choice', (['choices'], {}), '(choices)\n', (391, 400), False, 'import random\n'), ((443, 484), 'lib.env_config.EnvConfig', 'env_config.EnvConfig', (['"""config/debug.json"""'], {}), "('config/debug.json')\n", (463, 484), False, 'from lib import env_config\n'), ((495, 521), 'lib.se... |
ShepardPower/PyMCBuilder | src/clcore.py | b247151864cc6b7bca0dc23aa87cdbb44b52defc | # I'm just the one that executes the instructions!
import sys, math, json, operator, time
import mcpi.minecraft as minecraft
from PIL import Image as pillow
from blockid import get_block
import mcpi.block as block
import functions as pymc
from tqdm import tqdm
import tkinter as tk
# Functions
# Main code
mc = minecra... | [((313, 341), 'mcpi.minecraft.Minecraft.create', 'minecraft.Minecraft.create', ([], {}), '()\n', (339, 341), True, 'import mcpi.minecraft as minecraft\n'), ((883, 908), 'tqdm.tqdm', 'tqdm', ([], {'total': '(imhei * imwid)'}), '(total=imhei * imwid)\n', (887, 908), False, 'from tqdm import tqdm\n'), ((1304, 1327), 'func... |
987Frogh/project-makehuman | gaphor/tools/gaphorconvert.py | 3afc838b03c50f8e574d8c87cb71de4435a18a6d | #!/usr/bin/python
import optparse
import os
import re
import sys
import cairo
from gaphas.painter import Context, ItemPainter
from gaphas.view import View
import gaphor.UML as UML
from gaphor.application import Application
from gaphor.storage import storage
def pkg2dir(package):
"""
Return directory path f... | [((852, 886), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': 'usage'}), '(usage=usage)\n', (873, 886), False, 'import optparse\n'), ((1901, 1990), 'gaphor.application.Application.init', 'Application.init', ([], {'services': "['event_manager', 'component_registry', 'element_factory']"}), "(services=['e... |
prettyirrelevant/zeta-python-sdk | zeta_python_sdk/exceptions.py | 536967259c89d380b8853b1cfd0621c50143b8b9 | class InvalidSideException(Exception):
"""Invalid side"""
class NotSupportedException(Exception):
"""Not supported by dummy wallet"""
class InvalidProductException(Exception):
"""Invalid product type"""
class OutOfBoundsException(Exception):
"""Attempt to access memory outside buffer bounds"""
| [] |
a-buntjer/tsib | test/test_ID.py | 9d6ddcdca55c9b8afb5324c0da8d0910cb1a326e | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 08 11:33:01 2016
@author: Leander Kotzur
"""
import tsib
def test_get_ID():
# parameterize a building
bdgcfg = tsib.BuildingConfiguration(
{
"refurbishment": False,
"nightReduction": False,
"occControl": False,
... | [((170, 396), 'tsib.BuildingConfiguration', 'tsib.BuildingConfiguration', (["{'refurbishment': False, 'nightReduction': False, 'occControl': False,\n 'capControl': True, 'n_persons': 2, 'roofOrientation': 0.0,\n 'n_apartments': 1, 'latitude': 49.0, 'longitude': 12.0}"], {}), "({'refurbishment': False, 'nightReduc... |
alexbarcelo/dislib | dislib/model_selection/_search.py | 989f81f235ae30b17410a8d805df258c7d931b38 | from abc import ABC, abstractmethod
from collections import defaultdict
from collections.abc import Sequence
from functools import partial
from itertools import product
import numpy as np
from pycompss.api.api import compss_wait_on
from scipy.stats import rankdata
from sklearn import clone
from sklearn.model_selection... | [((1557, 1574), 'dislib.model_selection._split.infer_cv', 'infer_cv', (['self.cv'], {}), '(self.cv)\n', (1565, 1574), False, 'from dislib.model_selection._split import infer_cv\n'), ((1656, 1672), 'sklearn.clone', 'clone', (['estimator'], {}), '(estimator)\n', (1661, 1672), False, 'from sklearn import clone\n'), ((4545... |
robseed/botanist | webapp/ui/tests/test_parse_search_results.py | 2f4fbab5d26499105a5057c86e0e6e37a2e8a727 | import os
from django.test import TestCase
from mock import patch
from ui.views import parse_search_results
FIXTURES_ROOT = os.path.join(os.path.dirname(__file__), 'fixtures')
FX = lambda *relpath: os.path.join(FIXTURES_ROOT, *relpath)
@patch('ui.views.get_repo_type')
@patch('ui.views.CODE_ROOT', '/opt/botanist/re... | [((242, 273), 'mock.patch', 'patch', (['"""ui.views.get_repo_type"""'], {}), "('ui.views.get_repo_type')\n", (247, 273), False, 'from mock import patch\n'), ((275, 325), 'mock.patch', 'patch', (['"""ui.views.CODE_ROOT"""', '"""/opt/botanist/repos"""'], {}), "('ui.views.CODE_ROOT', '/opt/botanist/repos')\n", (280, 325),... |
Clariteia/api_gateway_common | minos/api_gateway/common/exceptions.py | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | """
Copyright (C) 2021 Clariteia SL
This file is part of minos framework.
Minos framework can not be copied and/or distributed without the express permission of Clariteia SL.
"""
from typing import (
Any,
Type,
)
class MinosException(Exception):
"""Exception class for import packages or modules"""
... | [] |
burgerdev/hostload | tsdl/tools/extensions.py | 93142628bb32923c5e6f3a8b791488d72a5c9077 | """
Extensions for pylearn2 training algorithms. Those are either reimplemented to
suit the execution model of this package, or new ones for recording metrics.
"""
import os
import cPickle as pkl
import numpy as np
from pylearn2.train_extensions import TrainExtension
from .abcs import Buildable
class BuildableTr... | [((2160, 2202), 'os.path.join', 'os.path.join', (['self._wd', '"""weightkeeper.pkl"""'], {}), "(self._wd, 'weightkeeper.pkl')\n", (2172, 2202), False, 'import os\n'), ((3095, 3127), 'os.path.join', 'os.path.join', (['self._wd', 'filename'], {}), '(self._wd, filename)\n', (3107, 3127), False, 'import os\n'), ((2254, 228... |
Cooomma/nogi-backup-blog | nogi/utils/post_extractor.py | 19868511d2b0f0c4d06bf4a88981bbfadc4121e4 | import asyncio
from io import BytesIO
import logging
import os
import random
import time
from typing import List
from urllib.parse import urlparse
import aiohttp
from aiohttp import ClientSession, TCPConnector
import requests
from requests import Response
from tqdm import tqdm
from nogi import REQUEST_HEADERS
from no... | [((526, 545), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (543, 545), False, 'import logging\n'), ((1157, 1198), 'os.path.join', 'os.path.join', (["member['roma_name']", '"""post"""'], {}), "(member['roma_name'], 'post')\n", (1169, 1198), False, 'import os\n'), ((1240, 1280), 'os.path.join', 'os.path.jo... |
threefoldtech/threebot_prebuilt | sandbox/lib/jumpscale/JumpscaleLibsExtra/sal_zos/gateway/dhcp.py | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | from Jumpscale import j
import signal
from .. import templates
DNSMASQ = "/bin/dnsmasq --conf-file=/etc/dnsmasq.conf -d"
class DHCP:
def __init__(self, container, domain, networks):
self.container = container
self.domain = domain
self.networks = networks
def apply_config(self):
... | [((774, 822), 'Jumpscale.j.tools.timer.execute_until', 'j.tools.timer.execute_until', (['self.is_running', '(10)'], {}), '(self.is_running, 10)\n', (801, 822), False, 'from Jumpscale import j\n'), ((842, 884), 'Jumpscale.j.exceptions.Base', 'j.exceptions.Base', (['"""Failed to run dnsmasq"""'], {}), "('Failed to run dn... |
breeze-shared-inc/python_training_01 | answer/a4_type.py | 7e918b37adbce062ae279f060bc25cfacda2fb85 | hensu_int = 17 #数字
hensu_float = 1.7 #小数点(浮動小数点)
hensu_str = "HelloWorld" #文字列
hensu_bool = True #真偽
hensu_list = [] #リスト
hensu_tuple = () #タプル
hensu_dict = {} #辞書(ディクト)型
print(type(hensu_int))
print(type(hensu_float))
print(type(hensu_str))
print(type(hensu_bool))
print(type(hensu_list))
print(type(hensu_tuple))
prin... | [] |
UrsaLeo/LEDdebug | LEDdebug/examples/led-demo.py | 228af02468e4f3b617a50e6195931a623a4ad848 | #!/usr/bin/env python3
"""UrsaLeo LEDdebug board LED demo
Turn the LED's on one at a time, then all off"""
import time
ON = 1
OFF = 0
DELAY = 0.5 # seconds
try:
from LEDdebug import LEDdebug
except ImportError:
try:
import sys
import os
sys.path.append("..")
sys.path.appen... | [((570, 580), 'LEDdebug.LEDdebug', 'LEDdebug', ([], {}), '()\n', (578, 580), False, 'from LEDdebug import LEDdebug\n'), ((725, 742), 'time.sleep', 'time.sleep', (['DELAY'], {}), '(DELAY)\n', (735, 742), False, 'import time\n'), ((276, 297), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (291, 297... |
Nitin-Mane/SARS-CoV-2-xDNN-Classifier | modules/server.py | abb6a82b8ee89a041b0e26e14ec1e416c4561266 | #!/usr/bin/env python
###################################################################################
##
## Project: COVID -19 xDNN Classifier 2020
## Version: 1.0.0
## Module: Server
## Desription: The COVID -19 xDNN Classifier 2020 server.
## License: MIT
## Copyright: 2021, Asociacion De Investigac... | [((2531, 2577), 'tensorflow.keras.preprocessing.image.img_to_array', 'tf.keras.preprocessing.image.img_to_array', (['img'], {}), '(img)\n', (2572, 2577), True, 'import tensorflow as tf\n'), ((2728, 2758), 'numpy.expand_dims', 'np.expand_dims', (['np_img'], {'axis': '(0)'}), '(np_img, axis=0)\n', (2742, 2758), True, 'im... |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/allergyintolerance_tests.py | d28ad957557587b03ff9c63d55dd55e0508f91d8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import allergyintolerance
from .fhirdate import FHIRDate
class AllergyIntoleranceTests(unittest.TestCase):
def instantiate_from(self... | [((351, 390), 'os.environ.get', 'os.environ.get', (['"""FHIR_UNITTEST_DATADIR"""'], {}), "('FHIR_UNITTEST_DATADIR')\n", (365, 390), False, 'import os\n'), ((502, 519), 'json.load', 'json.load', (['handle'], {}), '(handle)\n', (511, 519), False, 'import json\n'), ((418, 449), 'os.path.join', 'os.path.join', (['datadir',... |
PyDee/Spiders | jsparse/meijiexia/meijiexia.py | 6fc0a414060032b5ba4332302285e3fcc9a6113e | import time
import random
import requests
from lxml import etree
import pymongo
from .url_file import mjx_weibo, mjx_dy, mjx_ks, mjx_xhs
class DBMongo:
def __init__(self):
self.my_client = pymongo.MongoClient("mongodb://localhost:27017/")
# 连接数据库
self.db = self.my_client["mcn"]
def i... | [((203, 252), 'pymongo.MongoClient', 'pymongo.MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (222, 252), False, 'import pymongo\n'), ((2201, 2257), 'requests.get', 'requests.get', (['url'], {'headers': 'self.headers', 'proxies': 'proxies'}), '(url, headers=self.headers, pr... |
jamster112233/ICS_IDS | MLModules/ABD/B_PCAQDA.py | dac6abc3c8d6e840a21adedcb9e8dcfaa304b499 | import numpy as np
from keras.utils import np_utils
import pandas as pd
import sys
from sklearn.preprocessing import LabelEncoder
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis as QDA
from sklearn.decomposition import PCA
import os
from sklearn.externals import joblib
from sklearn.metrics impor... | [((440, 503), 'pandas.read_csv', 'pd.read_csv', ([], {'filepath_or_buffer': 'trainName', 'header': 'None', 'sep': '""","""'}), "(filepath_or_buffer=trainName, header=None, sep=',')\n", (451, 503), True, 'import pandas as pd\n'), ((513, 575), 'pandas.read_csv', 'pd.read_csv', ([], {'filepath_or_buffer': 'testName', 'hea... |
203Null/Gravity-Rush-2-Save-Loader | GR2-Save-Loader.py | 40cf8a1748449c0e019a2e57ac2b8eccd50d8917 | import struct
import json
from collections import OrderedDict
file_path = "data0002.bin"
show_offset = True
show_hash = False
loaded_data = 0
def unpack(upstream_data_set):
global loaded_data
loaded_data = loaded_data + 1
currentCursor = file.tell()
print(hex(file.tell()))
file.seek(... | [((2328, 2341), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2339, 2341), False, 'from collections import OrderedDict\n'), ((2754, 2814), 'json.dump', 'json.dump', (['data_set', 'json_file'], {'indent': '(4)', 'ensure_ascii': '(False)'}), '(data_set, json_file, indent=4, ensure_ascii=False)\n', (2763, 2... |
itzsoumyadip/vs | python/Recursion.py | acf32cd0bacb26e62854060e0acf5eb41b7a68c8 | ## to change recursion limit
import sys
print(sys.getrecursionlimit()) #Return the current value of the recursion limit
#1000
## change the limit
sys.setrecursionlimit(2000) # change value of the recursion limit
#2000
i=0
def greet():
global i
i+=1
print('hellow',i)
greet()
greet() # hellow... | [((152, 179), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(2000)'], {}), '(2000)\n', (173, 179), False, 'import sys\n'), ((49, 72), 'sys.getrecursionlimit', 'sys.getrecursionlimit', ([], {}), '()\n', (70, 72), False, 'import sys\n')] |
andywar65/starter-fullstack | pages/tests/test_views.py | 683d6282eb02a9b967d15cd254976e67549672e9 | from django.test import TestCase, override_settings
from django.urls import reverse
from pages.models import Article, HomePage
@override_settings(USE_I18N=False)
class PageViewTest(TestCase):
@classmethod
def setUpTestData(cls):
print("\nTest page views")
# Set up non-modified objects used by... | [((131, 164), 'django.test.override_settings', 'override_settings', ([], {'USE_I18N': '(False)'}), '(USE_I18N=False)\n', (148, 164), False, 'from django.test import TestCase, override_settings\n'), ((346, 384), 'pages.models.HomePage.objects.create', 'HomePage.objects.create', ([], {'title': '"""Title"""'}), "(title='T... |
sunliwen/poco | poco/services/batch/server.py | a4b8c4ede63711eea42a444fb9d922c350855364 | #!/usr/bin/env python
import logging
import sys
sys.path.append("../../")
sys.path.append("pylib")
import time
import datetime
import pymongo
import uuid
import os
import subprocess
import os.path
import settings
from common.utils import getSiteDBCollection
sys.path.insert(0, "../../")
class LoggingManager:
de... | [((48, 73), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (63, 73), False, 'import sys\n'), ((74, 98), 'sys.path.append', 'sys.path.append', (['"""pylib"""'], {}), "('pylib')\n", (89, 98), False, 'import sys\n'), ((260, 288), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../"""']... |
makielab/django-oscar | tests/integration/basket/model_tests.py | 0a325cd0f04a4278201872b2e163868b72b6fabe | from decimal import Decimal as D
from django.test import TestCase
from oscar.apps.basket.models import Basket
from oscar.apps.partner import strategy
from oscar.test import factories
from oscar.apps.catalogue.models import Option
class TestAddingAProductToABasket(TestCase):
def setUp(self):
self.basket... | [((323, 331), 'oscar.apps.basket.models.Basket', 'Basket', ([], {}), '()\n', (329, 331), False, 'from oscar.apps.basket.models import Basket\n'), ((363, 381), 'oscar.apps.partner.strategy.Default', 'strategy.Default', ([], {}), '()\n', (379, 381), False, 'from oscar.apps.partner import strategy\n'), ((405, 431), 'oscar... |
code-watch/meltano | tests/fixtures/db/sqlite.py | 2afff73ed43669b5134dacfce61814f7f4e77a13 | import pytest
import os
import sqlalchemy
import contextlib
@pytest.fixture(scope="session")
def engine_uri(test_dir):
database_path = test_dir.joinpath("pytest_meltano.db")
try:
database_path.unlink()
except FileNotFoundError:
pass
return f"sqlite:///{database_path}"
| [((63, 94), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (77, 94), False, 'import pytest\n')] |
piotr-karon/realworld-starter-kit | experiments/render-tests-avg.py | 6285e4b5913fe5e99d72e9178eb4b1db246d02c9 | #!/usr/bin/env python3
import json
import os
from pathlib import Path
import numpy as np
from natsort import natsorted
try:
from docopt import docopt
from marko.ext.gfm import gfm
import pygal
from pygal.style import Style, DefaultStyle
except ImportError as e:
raise Exception('Some external depe... | [((800, 824), 'pathlib.Path', 'Path', (['"""bench-results.md"""'], {}), "('bench-results.md')\n", (804, 824), False, 'from pathlib import Path\n'), ((2966, 3021), 'pygal.Config', 'pygal.Config', ([], {'legend_at_bottom': '(True)', 'style': 'DefaultStyle'}), '(legend_at_bottom=True, style=DefaultStyle)\n', (2978, 3021),... |
osterwood/litex | litex/build/altera/quartus.py | db20cb172dc982c5879aa8080ec7aa18de181cc5 | #
# This file is part of LiteX.
#
# Copyright (c) 2014-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2019 msloniewski <marcin.sloniewski@gmail.com>
# Copyright (c) 2019 vytautasb <v.buitvydas@limemicro.com>
# SPDX-License-Identifier: BSD-2-Clause
import os
import subprocess
import sys
import math
f... | [((6459, 6525), 'litex.build.tools.write_to_file', 'tools.write_to_file', (['script_file', 'script_contents'], {'force_unix': '(True)'}), '(script_file, script_contents, force_unix=True)\n', (6478, 6525), False, 'from litex.build import tools\n'), ((6693, 6713), 'shutil.which', 'which', (['"""quartus_map"""'], {}), "('... |
arXiv/arxiv-canonical | arxiv/canonical/util.py | a758ed88a568f23a834288aed4dcf7039c1340cf | """Various helpers and utilities that don't belong anywhere else."""
from typing import Dict, Generic, TypeVar
KeyType = TypeVar('KeyType')
ValueType = TypeVar('ValueType')
class GenericMonoDict(Dict[KeyType, ValueType]):
"""A dict with specific key and value types."""
def __getitem__(self, key: KeyType) -... | [((123, 141), 'typing.TypeVar', 'TypeVar', (['"""KeyType"""'], {}), "('KeyType')\n", (130, 141), False, 'from typing import Dict, Generic, TypeVar\n'), ((154, 174), 'typing.TypeVar', 'TypeVar', (['"""ValueType"""'], {}), "('ValueType')\n", (161, 174), False, 'from typing import Dict, Generic, TypeVar\n')] |
Glucemy/Glucemy-back | records/urls.py | c9fcf7996b3f13c67697aadd449e3e32afb1fa1b | from rest_framework.routers import DefaultRouter
from records.views import RecordViewSet
router = DefaultRouter()
router.register('', RecordViewSet, basename='records')
urlpatterns = router.urls
| [((100, 115), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (113, 115), False, 'from rest_framework.routers import DefaultRouter\n')] |
polyaxon/polystores | polystores/stores/azure_store.py | 141789ef75622c80d1f3875cec6952ad3c2d5ec7 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
from rhea import RheaError
from rhea import parser as rhea_parser
from azure.common import AzureHttpError
from azure.storage.blob.models import BlobPrefix
from polystores.clients.azure_client import get_blob_service_c... | [((1913, 2034), 'polystores.clients.azure_client.get_blob_service_connection', 'get_blob_service_connection', ([], {'account_name': 'account_name', 'account_key': 'account_key', 'connection_string': 'connection_string'}), '(account_name=account_name, account_key=\n account_key, connection_string=connection_string)\n... |
dataplumber/nexus | analysis/webservice/NexusHandler.py | f25a89e85eba098da9c6db1ff3d408dae8a6b310 | """
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import sys
import numpy as np
import logging
import time
import types
from datetime import datetime
from netCDF4 import Dataset
from nexustiles.nexustiles import NexusTileService
from webservice.webmodel impor... | [((442, 469), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (459, 469), False, 'import logging\n'), ((822, 849), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (839, 849), False, 'import logging\n'), ((2833, 2860), 'logging.getLogger', 'logging.getLogger', ... |
ming71/SLA | utils/box/metric.py | 7024b093bc0d456b274314ebeae3bc500c2db65a | import numpy as np
from collections import defaultdict, Counter
from .rbbox_np import rbbox_iou
def get_ap(recall, precision):
recall = [0] + list(recall) + [1]
precision = [0] + list(precision) + [0]
for i in range(len(precision) - 1, 0, -1):
precision[i - 1] = max(precision[i - 1], precision[i... | [((522, 558), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(11)'], {'endpoint': '(True)'}), '(0, 1, 11, endpoint=True)\n', (533, 558), True, 'import numpy as np\n'), ((598, 610), 'numpy.any', 'np.any', (['mask'], {}), '(mask)\n', (604, 610), True, 'import numpy as np\n'), ((1134, 1167), 'collections.Counter', 'Cou... |
winstonschroeder/setlistmanager | app.py | 3c177a8da4bd56049964076f6ead51e3fffff5fa |
import logging
import pygame
from app import *
from pygame.locals import *
from werkzeug.serving import run_simple
from web import webapp as w
import data_access as da
logging.basicConfig(filename='setlistmanager.log', level=logging.DEBUG)
SCREEN_WIDTH = 160
SCREEN_HEIGHT = 128
class Button:
pass
class Text()... | [((171, 242), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""setlistmanager.log"""', 'level': 'logging.DEBUG'}), "(filename='setlistmanager.log', level=logging.DEBUG)\n", (190, 242), False, 'import logging\n'), ((641, 673), 'pygame.font.SysFont', 'pygame.font.SysFont', (['"""Arial"""', '(64)'], {})... |
Praznat/annotationmodeling | sim_keypoints.py | 014b8b94b2225f947691c18b26eb8a4b148d2c8a | import json
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import simulation
from eval_functions import oks_score_multi
import utils
def alter_location(points, x_offset, y_offset):
x, y = points.T
return np.array([x + x_offset, y + y_offset]).T
def alter_rotation(points, radians):... | [((336, 359), 'numpy.mean', 'np.mean', (['points'], {'axis': '(0)'}), '(points, axis=0)\n', (343, 359), True, 'import numpy as np\n'), ((496, 519), 'numpy.mean', 'np.mean', (['points'], {'axis': '(0)'}), '(points, axis=0)\n', (503, 519), True, 'import numpy as np\n'), ((2047, 2067), 'pandas.DataFrame', 'pd.DataFrame', ... |
Loptt/home-automation-system | local/controller.py | f1878596905e022d1d626d485d1a29dc7212f480 | import requests
import time
import os
import sys
import json
import threading
from getpass import getpass
import schedule
import event as e
import configuration as c
import RPi.GPIO as GPIO
#SERVER_URL = "https://home-automation-289621.uc.r.appspot.com"
#SERVER_URL = "http://127.0.0.1:4747"
SERVER_URL = "http://192.16... | [((586, 613), 'RPi.GPIO.output', 'GPIO.output', (['pin', 'GPIO.HIGH'], {}), '(pin, GPIO.HIGH)\n', (597, 613), True, 'import RPi.GPIO as GPIO\n'), ((673, 699), 'RPi.GPIO.output', 'GPIO.output', (['pin', 'GPIO.LOW'], {}), '(pin, GPIO.LOW)\n', (684, 699), True, 'import RPi.GPIO as GPIO\n'), ((779, 791), 'event.Time', 'e.T... |
gzzo/graphql-sqlalchemy | src/graphql_sqlalchemy/graphql_types.py | 54a30d0b2fe2d5a1eb3668f0f7bc6ec3cb366ec4 | from typing import Dict, Union
from graphql import (
GraphQLBoolean,
GraphQLFloat,
GraphQLInputField,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
GraphQLScalarType,
GraphQLString,
)
from sqlalchemy import ARRAY, Boolean, Float, Integer
from sqlalchemy.dialects.postgresql import ARRAY as PG... | [((979, 1010), 'graphql.GraphQLInputField', 'GraphQLInputField', (['graphql_type'], {}), '(graphql_type)\n', (996, 1010), False, 'from graphql import GraphQLBoolean, GraphQLFloat, GraphQLInputField, GraphQLInt, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLString\n'), ((1028, 1059), 'graphql.GraphQLInputField'... |
byterubpay/mininero1 | Knapsack.py | ea6b8017cdbab82011d7f329e7726cc52d1ef431 | import Crypto.Random.random as rand
import itertools
import math #for log
import sys
def decomposition(i):
#from stack exchange, don't think it's uniform
while i > 0:
n = rand.randint(1, i)
yield n
i -= n
def Decomposition(i):
while True:
l = list(decomposition(i))
i... | [((2353, 2378), 'Crypto.Random.random.shuffle', 'rand.shuffle', (['all_amounts'], {}), '(all_amounts)\n', (2365, 2378), True, 'import Crypto.Random.random as rand\n'), ((187, 205), 'Crypto.Random.random.randint', 'rand.randint', (['(1)', 'i'], {}), '(1, i)\n', (199, 205), True, 'import Crypto.Random.random as rand\n'),... |
rudolfwilliam/satellite_image_forecasting | drought_impact_forecasting/models/model_parts/Conv_Transformer.py | 164ee7e533e1a8d730a0ee9c0062fd9b32e0bcdc | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange
from .shared import Conv_Block
from ..utils.utils import zeros, mean_cube, last_frame, ENS
class Residual(nn.Module):
def __init__(self, fn):
super().__init__()
self.fn = fn
def f... | [((494, 511), 'torch.nn.LayerNorm', 'nn.LayerNorm', (['dim'], {}), '(dim)\n', (506, 511), True, 'import torch.nn as nn\n'), ((2972, 3000), 'torch.stack', 'torch.stack', (['([K] * s)'], {'dim': '(-2)'}), '([K] * s, dim=-2)\n', (2983, 3000), False, 'import torch\n'), ((3017, 3045), 'torch.stack', 'torch.stack', (['([V] *... |
rodrigoapereira/python-hydra-sdk | tests/test_clients.py | ea3d61ed6f7ef1bc1990c442548d21b10155d075 | # Copyright (C) 2017 O.S. Systems Software LTDA.
# This software is released under the MIT License
import unittest
from hydra import Hydra, Client
class ClientsTestCase(unittest.TestCase):
def setUp(self):
self.hydra = Hydra('http://localhost:4444', 'client', 'secret')
self.client = Client(
... | [((236, 286), 'hydra.Hydra', 'Hydra', (['"""http://localhost:4444"""', '"""client"""', '"""secret"""'], {}), "('http://localhost:4444', 'client', 'secret')\n", (241, 286), False, 'from hydra import Hydra, Client\n'), ((309, 439), 'hydra.Client', 'Client', ([], {'name': '"""new-client"""', 'secret': '"""client-secret"""... |
Phillistan16/fastestimator | test/PR_test/unit_test/backend/test_binary_crossentropy.py | 54c9254098aee89520814ed54b6e6016b821424f | # Copyright 2020 The FastEstimator 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [((909, 942), 'tensorflow.constant', 'tf.constant', (['[[1], [0], [1], [0]]'], {}), '([[1], [0], [1], [0]])\n', (920, 942), True, 'import tensorflow as tf\n'), ((965, 1006), 'tensorflow.constant', 'tf.constant', (['[[0.9], [0.3], [0.8], [0.1]]'], {}), '([[0.9], [0.3], [0.8], [0.1]])\n', (976, 1006), True, 'import tenso... |
kyeser/scTools | ats_hex.py | c4c7dee0c41c8afe1da6350243df5f9d9b929c7f | #!/usr/bin/env python
from scTools import interval, primeForm
from scTools.rowData import ats
from scTools.scData import *
count = 1
for w in ats:
prime = primeForm(w[0:6])
print '%3d\t' % count,
for x in w:
print '%X' % x,
print ' ',
intervals = interval(w)
for y in intervals:
... | [] |
Albert-91/precon | src/precon/commands.py | aaded1d6a5f743b3539ea46b19a37a7bf9930e05 | import asyncio
import click
from precon.devices_handlers.distance_sensor import show_distance as show_distance_func
from precon.remote_control import steer_vehicle, Screen
try:
import RPi.GPIO as GPIO
except (RuntimeError, ModuleNotFoundError):
import fake_rpi
GPIO = fake_rpi.RPi.GPIO
@click.command(n... | [((305, 329), 'click.command', 'click.command', ([], {'name': '"""rc"""'}), "(name='rc')\n", (318, 329), False, 'import click\n'), ((687, 722), 'click.command', 'click.command', ([], {'name': '"""show-distance"""'}), "(name='show-distance')\n", (700, 722), False, 'import click\n'), ((371, 395), 'asyncio.get_event_loop'... |
sjtichenor/midway-ford | midway.py | 43bf8770f2edd483d7c27dede8b9ac1fb8f10152 | import csv
import string
import ftplib
import math
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import sqlite... | [((583, 628), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '"""en_US.utf8"""'], {}), "(locale.LC_ALL, 'en_US.utf8')\n", (599, 628), False, 'import locale\n'), ((796, 831), 'pyvirtualdisplay.Display', 'Display', ([], {'visible': '(0)', 'size': '(800, 800)'}), '(visible=0, size=(800, 800))\n', (803, 831), F... |
edwinfeener/monolithe | monolithe/generators/sdkgenerator.py | 0f024b2ec7d4c5a2229612280e5e559bf2667ba5 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# no... | [((2126, 2156), 'os.path.exists', 'os.path.exists', (['overrides_path'], {}), '(overrides_path)\n', (2140, 2156), False, 'import os\n'), ((2293, 2328), 'os.path.exists', 'os.path.exists', (['attrs_defaults_path'], {}), '(attrs_defaults_path)\n', (2307, 2328), False, 'import os\n'), ((2459, 2491), 'os.path.exists', 'os.... |
kyuhoJeong11/GrewRL | rllab-taewoo/rllab/plotter/plotter.py | a514698df8d38df34de0bd1667d99927f0aa3885 | import atexit
import sys
if sys.version_info[0] == 2:
from Queue import Empty
else:
from queue import Empty
from multiprocessing import Process, Queue
from rllab.sampler.utils import rollout
import numpy as np
__all__ = [
'init_worker',
'init_plot',
'update_plot'
]
process = None
queue = None
de... | [((1499, 1506), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (1504, 1506), False, 'from multiprocessing import Process, Queue\n'), ((1521, 1550), 'multiprocessing.Process', 'Process', ([], {'target': '_worker_start'}), '(target=_worker_start)\n', (1528, 1550), False, 'from multiprocessing import Process, Queue\n... |
fotavio16/PycharmProjects | OpenCV/bookIntroCV_008_binarizacao.py | f5be49db941de69159ec543e8a6dde61f9f94d86 | '''
Livro-Introdução-a-Visão-Computacional-com-Python-e-OpenCV-3
Repositório de imagens
https://github.com/opencv/opencv/tree/master/samples/data
'''
import cv2
import numpy as np
from matplotlib import pyplot as plt
#import mahotas
VERMELHO = (0, 0, 255)
VERDE = (0, 255, 0)
AZUL = (255, 0, 0)
AMARELO = (0, 255, ... | [((395, 419), 'cv2.imread', 'cv2.imread', (['"""ponte2.jpg"""'], {}), "('ponte2.jpg')\n", (405, 419), False, 'import cv2\n'), ((532, 569), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (544, 569), False, 'import cv2\n'), ((579, 611), 'cv2.GaussianBlur', 'cv2.Gaussia... |
mechanicbuddy/djangito | djangito/backends.py | 07c08a83c57577cbf945bba461219bc0ef2a7695 | import base64
import json
import jwt
import requests
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
USER_MODEL = get_user_model()
class ALBAuth(ModelBackend):
def authenticate(self, request, **kwargs):
if request:
... | [((204, 220), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (218, 220), False, 'from django.contrib.auth import get_user_model\n'), ((711, 740), 'base64.b64decode', 'base64.b64decode', (['jwt_headers'], {}), '(jwt_headers)\n', (727, 740), False, 'import base64\n'), ((830, 861), 'json.loads',... |
gme5078/data-profiler | data_profiler/labelers/regex_model.py | 602cc5e4f4463f9b807000abf3893815918d0723 | import json
import os
import sys
import re
import copy
import numpy as np
from data_profiler.labelers.base_model import BaseModel
from data_profiler.labelers.base_model import AutoSubRegistrationMeta
_file_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(_file_dir)
class RegexModel(BaseModel, metac... | [((258, 284), 'sys.path.append', 'sys.path.append', (['_file_dir'], {}), '(_file_dir)\n', (273, 284), False, 'import sys\n'), ((231, 256), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (246, 256), False, 'import os\n'), ((7934, 7963), 'copy.deepcopy', 'copy.deepcopy', (['regex_patterns'], {}... |
JMosqueraM/algoritmos_y_programacion | taller_estructuras_de_control_selectivas/ejercicio_13.py | 30dc179b976f1db24401b110496250fbcb98938e | # Desarrolle un un programa que reciba la fecha de nacimiento
# de una persona, y como salida, indique el nombre del signo del
# zodiaco correspondiente, ademas de su edad
def zodiaco(DD, MM):
if (((DD >= 22) and (MM == 11)) or ((DD <=21) and (MM == 12))):
return("Sagitario")
if (((DD >= 22) and (MM ==... | [] |
vhazali/cs5331 | assignment3/crawler/spiders/benchmark_spider.py | 3b3618aaa17199ebcd3c01bc6c25ddbdbe4f3d0f | import re, scrapy
from crawler.items import *
class BenchmarkSpider(scrapy.Spider):
drop_params = True
# Spider name, for use with the scrapy crawl command
name = "benchmarks"
# Constants to get url parts
FULL, PROTOCOL, USER, PASSWORD, SUBDOMAIN, DOMAIN, TOP_LEVEL_DOMAIN, PORT_NUM, PATH, PAGE, GE... | [((2021, 2044), 're.search', 're.search', (['pattern', 'url'], {}), '(pattern, url)\n', (2030, 2044), False, 'import re, scrapy\n'), ((2776, 2799), 're.search', 're.search', (['pattern', 'url'], {}), '(pattern, url)\n', (2785, 2799), False, 'import re, scrapy\n'), ((5064, 5110), 'scrapy.Request', 'scrapy.Request', (['n... |
NeCTAR-RC/octavia-tempest-plugin | octavia_tempest_plugin/services/load_balancer/v2/listener_client.py | 5506c00b8d8972e6223499dd5a5da4c85c1ff836 | # Copyright 2017 GoDaddy
#
# 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 ... | [] |
isams1/Thesis | ryu/gui/views/router_address_delete.py | dfe03ce60169bd4e5b2eb6f1068a1c89fc9d9fd3 | import re
import logging
import httplib
import view_base
from models import rt_proxy
LOG = logging.getLogger('ryu.gui')
class RtAddrDel(view_base.ViewBase):
def __init__(self, host, port, dpid, address_id, status=None):
super(RtAddrDel, self).__init__()
self.host = host
self.port = port
... | [((93, 121), 'logging.getLogger', 'logging.getLogger', (['"""ryu.gui"""'], {}), "('ryu.gui')\n", (110, 121), False, 'import logging\n'), ((855, 917), 'models.rt_proxy.delete_router_address', 'rt_proxy.delete_router_address', (['address', 'address_no', 'self.dpid'], {}), '(address, address_no, self.dpid)\n', (885, 917),... |
TobiasRasbold/pywrangler | tests/util/test_helper.py | 3f4ba5891a75430e0882b223bda4c6c7f55dbd51 | """This module contains tests for the helper module.
"""
from pywrangler.util.helper import get_param_names
def test_get_param_names():
def func():
pass
assert get_param_names(func) == []
def func1(a, b=4, c=6):
pass
assert get_param_names(func1) == ["a", "b", "c"]
assert get... | [((182, 203), 'pywrangler.util.helper.get_param_names', 'get_param_names', (['func'], {}), '(func)\n', (197, 203), False, 'from pywrangler.util.helper import get_param_names\n'), ((264, 286), 'pywrangler.util.helper.get_param_names', 'get_param_names', (['func1'], {}), '(func1)\n', (279, 286), False, 'from pywrangler.u... |
jcgeo9/ML-For-Fish-Recognition | Python-Files/model_conversion/convert_to_tflite.py | 0b5faba77d0b2c5452950637f047882c80fa6fb7 | # =============================================================================
# Created By : Giannis Kostas Georgiou
# Project : Machine Learning for Fish Recognition (Individual Project)
# =============================================================================
# Description : File in order to convert save... | [((777, 829), 'tensorflow.lite.TFLiteConverter.from_saved_model', 'tf.lite.TFLiteConverter.from_saved_model', (['model_path'], {}), '(model_path)\n', (817, 829), True, 'import tensorflow as tf\n')] |
hedibejaoui/spark-timeseries | python3/sparkts/test/test_datetimeindex.py | 9112dcbbba4e095b5eb46c568e1c72e13e1f251a | from .test_utils import PySparkTestCase
from sparkts.datetimeindex import *
import pandas as pd
class DateTimeIndexTestCase(PySparkTestCase):
def test_frequencies(self):
bd = BusinessDayFrequency(1, 1, self.sc)
self.assertEqual(bd.days(), 1)
hf = HourFrequency(4, self.sc)
s... | [((1380, 1429), 'pandas.date_range', 'pd.date_range', (['"""2015-04-10"""'], {'periods': '(5)', 'freq': '"""3D"""'}), "('2015-04-10', periods=5, freq='3D')\n", (1393, 1429), True, 'import pandas as pd\n'), ((761, 789), 'pandas.to_datetime', 'pd.to_datetime', (['"""2015-04-10"""'], {}), "('2015-04-10')\n", (775, 789), T... |
rajitbanerjee/leetcode | src/listIntersect/inter.py | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
seen = set()
curr = headA
while curr:
seen.add(curr)
... | [] |
fact-project/photon_stream_production | photon_stream_production/tests/test_drs_run_assignment.py | ca2f946976c9a9717cfcd9364f2361ef385b45aa | import numpy as np
import photon_stream as ps
import photon_stream_production as psp
import pkg_resources
import os
runinfo_path = pkg_resources.resource_filename(
'photon_stream_production',
os.path.join('tests', 'resources', 'runinfo_20161115_to_20170103.csv')
)
drs_fRunID_for_obs_run = psp.drs_run._drs_fRu... | [((201, 271), 'os.path.join', 'os.path.join', (['"""tests"""', '"""resources"""', '"""runinfo_20161115_to_20170103.csv"""'], {}), "('tests', 'resources', 'runinfo_20161115_to_20170103.csv')\n", (213, 271), False, 'import os\n'), ((379, 409), 'photon_stream_production.runinfo.read', 'psp.runinfo.read', (['runinfo_path']... |
vikifox/CMDB | accounts/migrations/0001_initial.py | bac9b7da204c3eee344f55bb2187df38ef3b3d4c | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-18 05:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('cmdb', '0001_initial'),
('appc... | [((2316, 2430), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""accounts.RoleList"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='accounts.RoleList')\n", (2333, 2430), False,... |
gabrieladt/kops-ec2-autoscaler | autoscaler/azure.py | 8b90fa23caaacf9cf0a4310b65667769906af777 | import http
import logging
from typing import List, Tuple, MutableMapping
from datetime import datetime
import re
from requests.packages.urllib3 import Retry
import autoscaler.utils as utils
from autoscaler.autoscaling_groups import AutoScalingGroup
from autoscaler.azure_api import AzureApi, AzureScaleSet, AzureScale... | [((427, 454), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (444, 454), False, 'import logging\n'), ((3351, 3389), 're.compile', 're.compile', (['"""\\\\w+_(?P<class>[A-Z]+).+"""'], {}), "('\\\\w+_(?P<class>[A-Z]+).+')\n", (3361, 3389), False, 'import re\n'), ((9475, 9502), 'autoscaler.u... |
rachitmishra/45 | sort_insertion.py | c38650f4fa2ea1857848b95320cdc37929b39197 | """
Insertion Sort
Approach: Loop
Complexity: O(n2)
"""
def sort_insertion(input_arr):
print("""""""""""""""""""""""""")
print("input " + str(input_arr))
print("""""""""""""""""""""""""")
ln = len(input_arr)
i = 1 # Assuming first element is sorted
while i < ln: # n times
c = inpu... | [] |
eveiramirez/python_class | Python2/tareas/tarea_7.py | 7a3830cc92dc842b853b243c6b01e06993faa97e | """
NAME
tarea_7.py
VERSION
[1.0]
AUTHOR
Ignacio Emmanuel Ramirez Bernabe
CONTACT
iramirez@lcg.unam.mx
GITHUB
https://github.com/eveiramirez/python_class/blob/master/Python2/tareas/tarea_7.py
DESCRIPTION
Este programa contiene arrays estructurados para los arrays
... | [((565, 746), 'numpy.array', 'np.array', (["[('Gen1', 5, 3), ('Gen2', 11, 7), ('Gen3', 4, 9), ('Gen4', 2, 6)]"], {'dtype': "[('name', (np.str_, 10)), ('production_cond1', np.int32), (\n 'production_cond2', np.int32)]"}), "([('Gen1', 5, 3), ('Gen2', 11, 7), ('Gen3', 4, 9), ('Gen4', 2, 6)],\n dtype=[('name', (np.st... |
paypal/Iguanas | iguanas/pipeline/_base_pipeline.py | 166ea81b7d370eb4281a27aa449719ed1d38a74a | """
Base pipeline class. Main rule generator classes inherit from this one.
"""
from copy import deepcopy
from typing import List, Tuple, Union, Dict
from iguanas.pipeline.class_accessor import ClassAccessor
from iguanas.utils.typing import PandasDataFrameType, PandasSeriesType
import iguanas.utils.utils as utils
from ... | [((6125, 6178), 'iguanas.utils.utils.return_dataset_if_dict', 'utils.return_dataset_if_dict', ([], {'step_tag': 'step_tag', 'df': 'X'}), '(step_tag=step_tag, df=X)\n', (6153, 6178), True, 'import iguanas.utils.utils as utils\n'), ((1673, 1696), 'copy.deepcopy', 'deepcopy', (['step.__dict__'], {}), '(step.__dict__)\n', ... |
AlexanderMakarov/activitywatch-ets | test_activity_merger.py | 36e5ac92c7834b9515a54c5d633ae5e45d6928bc | import unittest
import datetime
from parameterized import parameterized
from activity_merger import Interval
from aw_core.models import Event
from typing import List, Tuple
def _build_datetime(seed: int) -> datetime.datetime:
return datetime.datetime(2000, 1, seed, seed, 0, 0).astimezone(datetime.timezone.utc)
... | [((6290, 6305), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6303, 6305), False, 'import unittest\n'), ((239, 283), 'datetime.datetime', 'datetime.datetime', (['(2000)', '(1)', 'seed', 'seed', '(0)', '(0)'], {}), '(2000, 1, seed, seed, 0, 0)\n', (256, 283), False, 'import datetime\n'), ((2894, 2915), 'datetime.... |
alekseynp/playground | pommerman/agents/player_agent.py | 523cc924fe9fd269a8eb3e29c45ace1c5c85b12c | """
NOTE:
There are a few minor complications to fluid human control which make this
code a little more involved than trivial.
1. Key press-release cycles can be, and often are, faster than one tick of
the game/simulation, but the player still wants that cycle to count, i.e.
to lay a bomb!
2. When holding down ... | [((1575, 1581), 'time.time', 'time', ([], {}), '()\n', (1579, 1581), False, 'from time import time\n'), ((2098, 2104), 'time.time', 'time', ([], {}), '()\n', (2102, 2104), False, 'from time import time\n'), ((1767, 1773), 'time.time', 'time', ([], {}), '()\n', (1771, 1773), False, 'from time import time\n'), ((1911, 19... |
sapshah-cisco/cobra | tests/rest/test_rest.py | e2b5a75495931844180b05d776c15829e63f0dab | # Copyright 2015 Cisco Systems, 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 required by applicable law or agreed to in ... | [((659, 693), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (691, 693), False, 'from future import standard_library\n'), ((1121, 1149), 'pytest.importorskip', 'pytest.importorskip', (['"""cobra"""'], {}), "('cobra')\n", (1140, 1149), False, 'import pytest\n'), ((1164, ... |
omaraljazairy/FedalAPI | spanglish/tests/fixtures/models/language.py | 2be0a19bb2629be9e2a0477f99477e4bfbd8901e | """ fixtures that return an sql statement with a list of values to be inserted."""
def load_language():
""" return the sql and values of the insert queuery."""
sql = """
INSERT INTO Spanglish_Test.Language
(
`name`, `iso-639-1`
)
VALUES (%s, %s)
... | [] |
tradewartracker/phase-one-product-hs2 | main-hs2.py | 38dd328a8211695c31f09a34832535dc2c82a5c2 | import datetime as dt
from os.path import dirname, join
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
from bokeh.io import curdoc
from bokeh.layouts import column, gridplot, row
from bokeh.models import ColumnDataSource, DataRange1d, Select, HoverTool, Panel, Tabs, LinearC... | [((902, 925), 'datetime.datetime', 'dt.datetime', (['(2017)', '(7)', '(1)'], {}), '(2017, 7, 1)\n', (913, 925), True, 'import datetime as dt\n'), ((935, 958), 'datetime.datetime', 'dt.datetime', (['(2022)', '(1)', '(1)'], {}), '(2022, 1, 1)\n', (946, 958), True, 'import datetime as dt\n'), ((7986, 8121), 'bokeh.models.... |
alxpy/aiohttp-middlewares | aiohttp_middlewares/https.py | 377740d21cdaf3142523eb81b0cee4c6dd01f6b5 | """
================
HTTPS Middleware
================
Change scheme for current request when aiohttp application deployed behind
reverse proxy with HTTPS enabled.
Usage
=====
.. code-block:: python
from aiohttp import web
from aiohttp_middlewares import https_middleware
# Basic usage
app = web.App... | [((736, 763), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (753, 763), False, 'import logging\n')] |
nohamanona/poke-auto-fuka | show/drawing.py | 9d355694efa0168738795afb403fc89264dcaeae | import cv2
import numpy as np
class DrawingClass(object):
def __init__(self):
self.draw_command ='None'
self.frame_count = 0
def drawing(self, frame, fps, num_egg, htc_egg, state):
cv2.putText(frame, 'FPS: {:.2f}'.format(fps),
(10, 30), cv2.FONT_HERSHEY_SIMP... | [((2771, 2831), 'cv2.circle', 'cv2.circle', (['frame', '(1000, 490)', '(50)', '(0, 0, 255)'], {'thickness': '(2)'}), '(frame, (1000, 490), 50, (0, 0, 255), thickness=2)\n', (2781, 2831), False, 'import cv2\n'), ((2140, 2200), 'cv2.circle', 'cv2.circle', (['frame', '(970, 490)', '(20)', '(0, 0, 255)'], {'thickness': '(-... |
YangTaoCN/IntroNeuralNetworks | backtest.py | 45b0311f85c9cdd9d3f0806e0059201e2655697f | import pandas_datareader.data as pdr
import yfinance as fix
import numpy as np
fix.pdr_override()
def back_test(strategy, seq_len, ticker, start_date, end_date, dim):
"""
A simple back test for a given date period
:param strategy: the chosen strategy. Note to have already formed the model, and fitted with... | [((79, 97), 'yfinance.pdr_override', 'fix.pdr_override', ([], {}), '()\n', (95, 97), True, 'import yfinance as fix\n'), ((785, 833), 'pandas_datareader.data.get_data_yahoo', 'pdr.get_data_yahoo', (['ticker', 'start_date', 'end_date'], {}), '(ticker, start_date, end_date)\n', (803, 833), True, 'import pandas_datareader.... |
jbueck/tespy | src/tespy/components/subsystems.py | dd7a2633ce12f33b4936ae902f4fe5df29191690 | # -*- coding: utf-8
"""Module for custom component groups.
It is possible to create subsystems of component groups in tespy. The subsystem
class is the base class for custom subsystems.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control ... | [((1158, 1176), 'logging.error', 'logging.error', (['msg'], {}), '(msg)\n', (1171, 1176), False, 'import logging\n'), ((2040, 2058), 'logging.error', 'logging.error', (['msg'], {}), '(msg)\n', (2053, 2058), False, 'import logging\n'), ((1362, 1380), 'logging.error', 'logging.error', (['msg'], {}), '(msg)\n', (1375, 138... |
blefaudeux/fairscale | fairscale/optim/oss.py | aa5850107a37c7d5644b6079516e7ae1079ff5e8 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
import copy
import logging
from typing import TYPE_CHECKING, Any, Callable, List, Optional, Type
import torch
import tor... | [((1909, 1929), 'torch.distributed.get_rank', 'dist.get_rank', (['group'], {}), '(group)\n', (1922, 1929), True, 'import torch.distributed as dist\n'), ((2532, 2563), 'torch.distributed.get_world_size', 'dist.get_world_size', (['self.group'], {}), '(self.group)\n', (2551, 2563), True, 'import torch.distributed as dist\... |
ninezerozeronine/raytracing-one-weekend | setup.py | 22ca36dcec679cbd78a7711734ca22e01ef06ef2 | from setuptools import setup, find_packages
setup(
name="raytracing-one-weekend",
version="0.0.0",
author="Andy Palmer",
author_email="contactninezerozeronine@gmail.com",
description="A raytracer achievable in a weekend.",
url="https://github.com/ninezerozeronine/raytracing-one-weekend",
in... | [((392, 412), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (405, 412), False, 'from setuptools import setup, find_packages\n')] |
r0kym/SNI-backend | homepage/urls.py | 5fdc25df21846fadb313d439acba73782a6248c3 | """
URLconf of the homepage
"""
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('auth', views.auth, name='auth'),
path('auth/public', views.auth_public, name='auth-public'),
path('auth/full', views.auth_full, name='auth-full'),
p... | [((115, 148), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home"""'}), "('', views.home, name='home')\n", (119, 148), False, 'from django.urls import path, include\n'), ((154, 191), 'django.urls.path', 'path', (['"""auth"""', 'views.auth'], {'name': '"""auth"""'}), "('auth', views.auth, name='aut... |
mas90/srcf-python | srcflib/email/__init__.py | 09ce45c65d2ddbec2cdfc559a7b5983398dbdfa0 | """
Notification email machinery, for tasks to send credentials and instructions to users.
Email templates placed inside the `templates` directory of this module should:
- extend from `layout`
- provide `subject` and `body` blocks
"""
from enum import Enum
import os.path
from jinja2 import Environment, FileSystemLo... | [((2983, 3057), 'srcf.mail.send_mail', 'send_mail', (['recipient', 'subject', 'body'], {'copy_sysadmins': '(False)', 'session': 'session'}), '(recipient, subject, body, copy_sysadmins=False, session=session)\n', (2992, 3057), False, 'from srcf.mail import send_mail\n')] |
dolfandringa/PythonProjectStructureDemo | nose2_example/my_package/myapp.py | 8bdd72b94d3b830e9e9dce548cca1cdb16601d0d | from .operations import Multiply, Add, Substract
class MyApp(object):
def __init__(self):
self.operations={'multiply': Multiply,
'add': Add,
'substract': Substract}
def do(self, operation, number1, number2):
return self.operations[operation.low... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.