max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
disk-cleanup-macros/python-runnables/display-analysis-data-used-space-1-summary/runnable.py | gbetegon88/dataiku-contrib | 93 | 6626651 | from dataiku.runnables import Runnable, ResultTable
import dataiku
import subprocess
import os, os.path as osp
import cleanup
class MyRunnable(Runnable):
def __init__(self, project_key, config, plugin_config):
self.project_key = project_key
self.config = config
def get_progress_target(... | from dataiku.runnables import Runnable, ResultTable
import dataiku
import subprocess
import os, os.path as osp
import cleanup
class MyRunnable(Runnable):
def __init__(self, project_key, config, plugin_config):
self.project_key = project_key
self.config = config
def get_progress_target(... | none | 1 | 2.239997 | 2 | |
src/ratingservice/main.py | Ayelet41/cloud-ops-sandbox | 229 | 6626652 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | en | 0.813704 | # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s... | 2.257002 | 2 |
tests/strategies/coordinator/test_orderer.py | y-tetsu/othello | 10 | 6626653 | <gh_stars>1-10
"""Tests of orderer.py
"""
import unittest
from reversi.board import BitBoard
from reversi.strategies.coordinator import Orderer, Orderer_B, Orderer_C, Orderer_P, Orderer_BC, Orderer_CB, Orderer_PCB
class TestOrderer(unittest.TestCase):
"""orderer
"""
def test_orderer(self):
board... | """Tests of orderer.py
"""
import unittest
from reversi.board import BitBoard
from reversi.strategies.coordinator import Orderer, Orderer_B, Orderer_C, Orderer_P, Orderer_BC, Orderer_CB, Orderer_PCB
class TestOrderer(unittest.TestCase):
"""orderer
"""
def test_orderer(self):
board = BitBoard(8)
... | en | 0.331693 | Tests of orderer.py orderer | 3.035022 | 3 |
tests/sig/test_fbanks.py | raymondxyy/pyaudlib | 26 | 6626654 | from audlib.sig.fbanks import MelFreq, ConstantQ
from audlib.quickstart import welcome
from audlib.sig.window import hamming
from audlib.sig.transform import stmfcc
import numpy as np
import scipy.signal as signal
sig, sr = welcome()
def test_mfcc():
# TODO: need to add proper testing.
nfft = 512
nmel =... | from audlib.sig.fbanks import MelFreq, ConstantQ
from audlib.quickstart import welcome
from audlib.sig.window import hamming
from audlib.sig.transform import stmfcc
import numpy as np
import scipy.signal as signal
sig, sr = welcome()
def test_mfcc():
# TODO: need to add proper testing.
nfft = 512
nmel =... | en | 0.667107 | # TODO: need to add proper testing. Test constant Q transform. Test filterbank synthesis. | 2.424739 | 2 |
src/iOS/toga_iOS/widgets/progressbar.py | luizoti/toga | 1,261 | 6626655 | <filename>src/iOS/toga_iOS/widgets/progressbar.py
from travertino.size import at_least
from toga_iOS.libs import CGSize, UIProgressView, UIProgressViewStyle
from toga_iOS.widgets.base import Widget
class ProgressBar(Widget):
def create(self):
self.native = UIProgressView.alloc().initWithProgressViewStyl... | <filename>src/iOS/toga_iOS/widgets/progressbar.py
from travertino.size import at_least
from toga_iOS.libs import CGSize, UIProgressView, UIProgressViewStyle
from toga_iOS.widgets.base import Widget
class ProgressBar(Widget):
def create(self):
self.native = UIProgressView.alloc().initWithProgressViewStyl... | en | 0.762835 | # Indeterminate progress is not supported for UIProgressView in iOS | 2.185416 | 2 |
parcels/plotting.py | jelletreep/parcels | 0 | 6626656 | <gh_stars>0
from datetime import datetime
from datetime import timedelta as delta
import numpy as np
from parcels.field import Field
from parcels.field import VectorField
from parcels.grid import CurvilinearGrid
from parcels.grid import GridCode
from parcels.tools.error import TimeExtrapolationError
from parcels.tool... | from datetime import datetime
from datetime import timedelta as delta
import numpy as np
from parcels.field import Field
from parcels.field import VectorField
from parcels.grid import CurvilinearGrid
from parcels.grid import GridCode
from parcels.tools.error import TimeExtrapolationError
from parcels.tools.loggers im... | en | 0.821714 | Function to plot a Parcels ParticleSet :param show_time: Time at which to show the ParticleSet :param with_particles: Boolean whether particles are also plotted on Field :param field: Field to plot under particles (either None, a Field object, or 'vector') :param domain: dictionary (with keys 'N', 'S',... | 2.352203 | 2 |
bigtable/tests/unit/test_table.py | hugovk/google-cloud-python | 1 | 6626657 | <filename>bigtable/tests/unit/test_table.py
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | <filename>bigtable/tests/unit/test_table.py
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | en | 0.840471 | # Copyright 2015 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s... | 2.271503 | 2 |
PDF_Text_Extractor/src/PDF_Extractor.py | jamescrone1/Python-PDF-Extractor | 0 | 6626658 | <reponame>jamescrone1/Python-PDF-Extractor
import PyPDF2
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.converter import TextConverter, PDFPageAggregator
from pdfminer.layout import LAParams
from pdfminer.layout import LTTextBoxHorizontal
from i... | import PyPDF2
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.converter import TextConverter, PDFPageAggregator
from pdfminer.layout import LAParams
from pdfminer.layout import LTTextBoxHorizontal
from io import StringIO
# PDFMiner method
def p... | fr | 0.293569 | # PDFMiner method # PyPDF2 method | 2.882123 | 3 |
src/primaires/format/__init__.py | stormi/tsunami | 0 | 6626659 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 <NAME>
# 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 notice, this
# list of cond... | # -*-coding:Utf-8 -*
# Copyright (c) 2010 <NAME>
# 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 notice, this
# list of cond... | en | 0.330602 | # -*-coding:Utf-8 -* # Copyright (c) 2010 <NAME> # 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 notice, this # list of condi... | 1.501011 | 2 |
sympy/integrals/benchmarks/bench_integrate.py | iamabhishek0/sympy | 445 | 6626660 | <filename>sympy/integrals/benchmarks/bench_integrate.py
from __future__ import print_function, division
from sympy import integrate, Symbol, sin
x = Symbol('x')
def bench_integrate_sin():
integrate(sin(x), x)
def bench_integrate_x1sin():
integrate(x**1*sin(x), x)
def bench_integrate_x2sin():
integra... | <filename>sympy/integrals/benchmarks/bench_integrate.py
from __future__ import print_function, division
from sympy import integrate, Symbol, sin
x = Symbol('x')
def bench_integrate_sin():
integrate(sin(x), x)
def bench_integrate_x1sin():
integrate(x**1*sin(x), x)
def bench_integrate_x2sin():
integra... | none | 1 | 2.545182 | 3 | |
addons/snailmail/models/snailmail_letter.py | SHIVJITH/Odoo_Machine_Test | 0 | 6626661 | <reponame>SHIVJITH/Odoo_Machine_Test
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import base64
from odoo import fields, models, api, _
from odoo.addons.iap.tools import iap_tools
from odoo.tools.safe_eval import safe_eval
DEFAULT_ENDPOINT = 'https://iap... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import base64
from odoo import fields, models, api, _
from odoo.addons.iap.tools import iap_tools
from odoo.tools.safe_eval import safe_eval
DEFAULT_ENDPOINT = 'https://iap-snailmail.odoo.com'
PRINT_ENDPOINT =... | en | 0.733796 | # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # discard Inbox notification This method will check if we have any existent attachement matching the model and res_ids and create them if not found. # report = self.env.ref('account.account_invoices') # override d... | 1.787769 | 2 |
setup.py | caos21/Grodi | 2 | 6626662 | #
# Copyright 2019 <NAME>
#
# 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 ... | #
# Copyright 2019 <NAME>
#
# 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 ... | en | 0.846117 | # # Copyright 2019 <NAME> # # 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 ... | 1.716371 | 2 |
ansiotropy/models/soft_t5.py | ethankim00/soft_prompt_ansiotropy | 0 | 6626663 | <reponame>ethankim00/soft_prompt_ansiotropy<filename>ansiotropy/models/soft_t5.py
from tqdm import tqdm
from openprompt.data_utils import PROCESSORS
import torch
from openprompt.data_utils.utils import InputExample
import argparse
import numpy as np
from pathlib import Path
from datetime import datetime
import json
imp... | from tqdm import tqdm
from openprompt.data_utils import PROCESSORS
import torch
from openprompt.data_utils.utils import InputExample
import argparse
import numpy as np
from pathlib import Path
from datetime import datetime
import json
import pickle
from openprompt import PromptDataLoader
from openprompt.prompts import... | en | 0.790699 | # sometimes, huggingface datasets can not be automatically downloaded due to network issue, please refer to 0_basic.py line 15 for solutions. # use lm-adapted version or t5-v1.1 checkpoint. Note that the originial t5 checkpoint has been pretrained # on part of GLUE dataset, thus should not be used. # Below are multiple... | 2.1432 | 2 |
LeetCode/Python3/Stack&PriorityQueue/150. Evaluate Reverse Polish Notation.py | WatsonWangZh/CodingPractice | 11 | 6626664 | <gh_stars>10-100
# Evaluate the value of an arithmetic expression in Reverse Polish Notation.
# Valid operators are +, -, *, /. Each operand may be an integer or another expression.
# Note:
# Division between two integers should truncate toward zero.
# The given RPN expression is always valid.
# That means the express... | # Evaluate the value of an arithmetic expression in Reverse Polish Notation.
# Valid operators are +, -, *, /. Each operand may be an integer or another expression.
# Note:
# Division between two integers should truncate toward zero.
# The given RPN expression is always valid.
# That means the expression would always ... | en | 0.660244 | # Evaluate the value of an arithmetic expression in Reverse Polish Notation. # Valid operators are +, -, *, /. Each operand may be an integer or another expression. # Note: # Division between two integers should truncate toward zero. # The given RPN expression is always valid. # That means the expression would always e... | 4.049736 | 4 |
src/Pybind11Wraps/SpheralCommon.py | markguozhiming/spheral | 1 | 6626665 | #-------------------------------------------------------------------------------
# Common PYB11 initialization code for all Spheral modules.
#-------------------------------------------------------------------------------
from PYB11Generator import *
PYB11includes = ['"Geometry/Dimension.hh"',
'"Geome... | #-------------------------------------------------------------------------------
# Common PYB11 initialization code for all Spheral modules.
#-------------------------------------------------------------------------------
from PYB11Generator import *
PYB11includes = ['"Geometry/Dimension.hh"',
'"Geome... | en | 0.366421 | #------------------------------------------------------------------------------- # Common PYB11 initialization code for all Spheral modules. #------------------------------------------------------------------------------- typedef Spheral::GeomPlane<Spheral::Dim<1>> Plane1d; typedef Spheral::Dim<1>::Vector Vector1d; typ... | 2.10816 | 2 |
src/analysis_integrity/hashlock.py | inakleinbottle/analysis_integrity | 0 | 6626666 | <filename>src/analysis_integrity/hashlock.py
import hmac
import hashlib
import json
import pathlib
import sys
import warnings
class HashLockError(Exception):
pass
class HashLock:
hash = hashlib.sha256
lock_file_name = "hash_lock.json"
def __init__(self, name, *files):
self.name = name
... | <filename>src/analysis_integrity/hashlock.py
import hmac
import hashlib
import json
import pathlib
import sys
import warnings
class HashLockError(Exception):
pass
class HashLock:
hash = hashlib.sha256
lock_file_name = "hash_lock.json"
def __init__(self, name, *files):
self.name = name
... | en | 0.951887 | # This is symmetric difference of sets | 3.060903 | 3 |
python/uw/like2/convolution.py | tburnett/pointlike | 1 | 6626667 | """
Convolution interface for like2
Extends classes from uw.utilities
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/like2/convolution.py,v 1.9 2018/01/27 15:37:17 burnett Exp $
author: <NAME>
"""
import os, pickle, zipfile
import numpy as np
import pandas as pd
from uw.utilities import keyword_options
... | """
Convolution interface for like2
Extends classes from uw.utilities
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/like2/convolution.py,v 1.9 2018/01/27 15:37:17 burnett Exp $
author: <NAME>
"""
import os, pickle, zipfile
import numpy as np
import pandas as pd
from uw.utilities import keyword_options
... | en | 0.609807 | Convolution interface for like2 Extends classes from uw.utilities $Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/like2/convolution.py,v 1.9 2018/01/27 15:37:17 burnett Exp $ author: <NAME> #from Science Tools: for SkyDir A Mixin class for like2 convolution, to replace functions in utilities.convolution E... | 2.254826 | 2 |
rlx2nix/util.py | relacs/rlx2nix | 0 | 6626668 | <filename>rlx2nix/util.py
import re
import enum
import nixio as nix
class ValueType(enum.Enum):
floating = 1
integer = 2
number_and_unit = 3
string = 4
only_number = re.compile("^([+-]?\\d+\\.?\\d*)$")
integer_number = re.compile("^[+-]?\\d+$")
number_and_unit = re.compile("^(^[+-]?\\d*\\.?\\d*)\\s?... | <filename>rlx2nix/util.py
import re
import enum
import nixio as nix
class ValueType(enum.Enum):
floating = 1
integer = 2
number_and_unit = 3
string = 4
only_number = re.compile("^([+-]?\\d+\\.?\\d*)$")
integer_number = re.compile("^[+-]?\\d+$")
number_and_unit = re.compile("^(^[+-]?\\d*\\.?\\d*)\\s?... | none | 1 | 2.937664 | 3 | |
msticpy/nbtools/entityschema.py | roopeshvs/msticpy | 4 | 6626669 | <filename>msticpy/nbtools/entityschema.py<gh_stars>1-10
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------... | <filename>msticpy/nbtools/entityschema.py<gh_stars>1-10
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------... | en | 0.446717 | # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- entitysche... | 1.926297 | 2 |
test/test_projects/c.py | sthagen/pypa-cibuildwheel | 0 | 6626670 | import jinja2
from .base import TestProject
SPAM_C_TEMPLATE = r"""
#include <Python.h>
{{ spam_c_top_level_add }}
static PyObject *
spam_system(PyObject *self, PyObject *args)
{
const char *command;
int sts;
if (!PyArg_ParseTuple(args, "s", &command))
return NULL;
sts = system(command);
... | import jinja2
from .base import TestProject
SPAM_C_TEMPLATE = r"""
#include <Python.h>
{{ spam_c_top_level_add }}
static PyObject *
spam_system(PyObject *self, PyObject *args)
{
const char *command;
int sts;
if (!PyArg_ParseTuple(args, "s", &command))
return NULL;
sts = system(command);
... | en | 0.287604 | #include <Python.h> {{ spam_c_top_level_add }} static PyObject * spam_system(PyObject *self, PyObject *args) { const char *command; int sts; if (!PyArg_ParseTuple(args, "s", &command)) return NULL; sts = system(command); {{ spam_c_function_add | indent(4) }} return PyLong_FromLong(... | 2.147182 | 2 |
noxfile.py | kianmeng/sphinx-autobuild | 264 | 6626671 | """Development automation."""
import nox
def _install_this_editable(session, *, extras=None):
if extras is None:
extras = []
session.install("flit")
session.run(
"flit",
"install",
"-s",
"--deps=production",
"--extras",
",".join(extras),
si... | """Development automation."""
import nox
def _install_this_editable(session, *, extras=None):
if extras is None:
extras = []
session.install("flit")
session.run(
"flit",
"install",
"-s",
"--deps=production",
"--extras",
",".join(extras),
si... | en | 0.630693 | Development automation. | 2.053603 | 2 |
tyrian/typarser/grammar_parser/__init__.py | Mause/tyrian | 1 | 6626672 | <filename>tyrian/typarser/grammar_parser/__init__.py
"""
Contains code for parsing the Grammar,
and for using it to parse a stream of tokens
"""
from .grammar_parser import GrammarParser
GrammarParser
| <filename>tyrian/typarser/grammar_parser/__init__.py
"""
Contains code for parsing the Grammar,
and for using it to parse a stream of tokens
"""
from .grammar_parser import GrammarParser
GrammarParser
| en | 0.759431 | Contains code for parsing the Grammar, and for using it to parse a stream of tokens | 1.778752 | 2 |
lib.py | CJ-5/Python_Adventure_Game | 0 | 6626673 | # Holds the main functions that operate the backend of the game (e.g battle system)
import os
from os import system
import lib
import movement_engine
import time
from colorama import Fore, Style
import game_data
import random
import math
import ctypes
import msvcrt
import subprocess
from ctypes import wintypes
from g... | # Holds the main functions that operate the backend of the game (e.g battle system)
import os
from os import system
import lib
import movement_engine
import time
from colorama import Fore, Style
import game_data
import random
import math
import ctypes
import msvcrt
import subprocess
from ctypes import wintypes
from g... | en | 0.785875 | # Holds the main functions that operate the backend of the game (e.g battle system) # logo_a: equivalent to "Adventure" # logo_b: equivalent to "Game" # Print the Logo # Check for new line # Spacing so text is not left-aligned # Initiate the max size of the console # I hate how long this took to figure out # specifie... | 2.42192 | 2 |
app/recipe/apps.py | AnshumanRohella/recipe-api | 0 | 6626674 | <reponame>AnshumanRohella/recipe-api<filename>app/recipe/apps.py
from django.apps import AppConfig
class RecipieConfig(AppConfig):
name = 'recipe'
| from django.apps import AppConfig
class RecipieConfig(AppConfig):
name = 'recipe' | none | 1 | 1.14439 | 1 | |
testauth/celery.py | buahaha/allianceauth-opcalendar | 0 | 6626675 | import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testauth.settings.local")
from django.conf import settings # noqa
app = Celery("testauth")
# Using a string here means the worker don't have to serialize
# the con... | import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testauth.settings.local")
from django.conf import settings # noqa
app = Celery("testauth")
# Using a string here means the worker don't have to serialize
# the con... | en | 0.709567 | # set the default Django settings module for the 'celery' program. # noqa # Using a string here means the worker don't have to serialize # the configuration object to child processes. # Load task modules from all registered Django app configs. | 2.029638 | 2 |
tests/test_model.py | probprog/pyprob | 268 | 6626676 | import unittest
import math
import torch
import os
import tempfile
import uuid
import pyprob
from pyprob import util, Model, InferenceEngine
from pyprob.distributions import Normal, Uniform, Empirical
importance_sampling_samples = 5000
class ModelTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs)... | import unittest
import math
import torch
import os
import tempfile
import uuid
import pyprob
from pyprob import util, Model, InferenceEngine
from pyprob.distributions import Normal, Uniform, Empirical
importance_sampling_samples = 5000
class ModelTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs)... | en | 0.402053 | # http://www.robots.ox.ac.uk/~fwood/assets/pdf/Wood-AISTATS-2014.pdf # prior.close() # http://www.robots.ox.ac.uk/~fwood/assets/pdf/Wood-AISTATS-2014.pdf # http://www.robots.ox.ac.uk/~fwood/assets/pdf/Wood-AISTATS-2014.pdf # pyprob.observe usage alternative #1 # http://www.robots.ox.ac.uk/~fwood/assets/pdf/Wood-AISTATS... | 2.344829 | 2 |
examples/manual_test.py | fossabot/vtk | 2 | 6626677 | <filename>examples/manual_test.py
import cv2
import os
import time
from termcolor import cprint
from vtk.inferrers.tensorflow import TensorFlowInferrer
start = time.time()
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
cprint("[0/6] Capturing frame...", "green", attrs=["bold"])
status, frame = cv2.VideoCapture(0).read()
cpri... | <filename>examples/manual_test.py
import cv2
import os
import time
from termcolor import cprint
from vtk.inferrers.tensorflow import TensorFlowInferrer
start = time.time()
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
cprint("[0/6] Capturing frame...", "green", attrs=["bold"])
status, frame = cv2.VideoCapture(0).read()
cpri... | none | 1 | 2.54266 | 3 | |
taln2016/icsisumm-primary-sys34_v1/preprocess/text.py | hectormartinez/rougexstem | 0 | 6626678 | <filename>taln2016/icsisumm-primary-sys34_v1/preprocess/text.py<gh_stars>0
import os, sys, re, math
import util
from globals import *
import nltk
import sbd
class TextProcessor:
def __init__(self):
self._no_punct_pattern = re.compile('[a-zA-Z0-9- ]')
self._stopwords = set(open(STOPWORDS).r... | <filename>taln2016/icsisumm-primary-sys34_v1/preprocess/text.py<gh_stars>0
import os, sys, re, math
import util
from globals import *
import nltk
import sbd
class TextProcessor:
def __init__(self):
self._no_punct_pattern = re.compile('[a-zA-Z0-9- ]')
self._stopwords = set(open(STOPWORDS).r... | en | 0.599903 | #self._sent_tokenizer = util.load_pickle('%s%s' %(STATIC_DATA_ROOT, 'punkt/m07_punkt.pickle')) unsupervised training given some text optional save_path for future use ## train tokenizer # threshold for identifying abbrevs (lower is more aggressive) ## pickle it ## fix end of sentence punctuation errors class fo... | 2.258119 | 2 |
cloudmesh-exercises/e-cloudmesh-common-3.py | cloudmesh-community/fa19-516-140 | 0 | 6626679 | <gh_stars>0
# fa19-516-140
#This program demonistrate the use of flatdict
#function which been stored in cloudmesh.common.flatdict
from cloudmesh.common.flatdict import FlatDict
#Assigining values to dicts
values = {'Cloudera': {'Address':{'USA':0,'CA': 1,'Palo Alto': 2}}}
# converting nested dicts to a one flat di... | # fa19-516-140
#This program demonistrate the use of flatdict
#function which been stored in cloudmesh.common.flatdict
from cloudmesh.common.flatdict import FlatDict
#Assigining values to dicts
values = {'Cloudera': {'Address':{'USA':0,'CA': 1,'Palo Alto': 2}}}
# converting nested dicts to a one flat dict that illu... | en | 0.801644 | # fa19-516-140 #This program demonistrate the use of flatdict #function which been stored in cloudmesh.common.flatdict #Assigining values to dicts # converting nested dicts to a one flat dict that illustrates all levels in one level with delimited keys #calling the flatdict in a key calling loop for each key based in t... | 3.46101 | 3 |
python/pyspark/tests/test_daemon.py | ILuffZhe/spark | 0 | 6626680 | <filename>python/pyspark/tests/test_daemon.py
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License,... | <filename>python/pyspark/tests/test_daemon.py
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License,... | en | 0.867186 | # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us... | 2.072551 | 2 |
bot.py | ilovetocode2019/Logger | 0 | 6626681 | import discord
from discord.ext import commands
import asyncpg
import aiohttp
import asyncio
import os
import logging
import json
import asyncio
import datetime
import config
from cogs.utils import formats
logging.basicConfig(
level=logging.INFO,
format="(%(asctime)s) %(levelname)s %(message)s",
datefmt... | import discord
from discord.ext import commands
import asyncpg
import aiohttp
import asyncio
import os
import logging
import json
import asyncio
import datetime
import config
from cogs.utils import formats
logging.basicConfig(
level=logging.INFO,
format="(%(asctime)s) %(levelname)s %(message)s",
datefmt... | en | 0.413161 | CREATE TABLE IF NOT EXISTS avatars ( id SERIAL PRIMARY KEY, user_id BIGINT, filename TEXT, hash TEXT, recorded_at TIMESTAMP DEFAULT (now() at time zone 'utc') ); CREATE TABLE IF NOT EXIS... | 2.252059 | 2 |
edx_data_research/reporting/report_stats.py | gopa1959/test | 0 | 6626682 | <filename>edx_data_research/reporting/report_stats.py
from collections import defaultdict
from datetime import date
from prettytable import PrettyTable
from edx_data_research.reporting.report import Report
class Stats(Report):
def __init__(self, args):
super(Stats, self).__init__(args)
self.csv ... | <filename>edx_data_research/reporting/report_stats.py
from collections import defaultdict
from datetime import date
from prettytable import PrettyTable
from edx_data_research.reporting.report import Report
class Stats(Report):
def __init__(self, args):
super(Stats, self).__init__(args)
self.csv ... | en | 0.698134 | Return general stats for a given course | 3.013191 | 3 |
pipeline_runner/cache.py | schinckel/pipeline-runner | 6 | 6626683 | import logging
import os.path
from tempfile import NamedTemporaryFile
from time import time as ts
from typing import Dict, List
from . import utils
from .config import config
from .container import ContainerRunner
logger = logging.getLogger(__name__)
DOCKER_IMAGES_ARCHIVE_FILE_NAME = "images.tar"
class CacheManage... | import logging
import os.path
from tempfile import NamedTemporaryFile
from time import time as ts
from typing import Dict, List
from . import utils
from .config import config
from .container import ContainerRunner
logger = logging.getLogger(__name__)
DOCKER_IMAGES_ARCHIVE_FILE_NAME = "images.tar"
class CacheManage... | none | 1 | 2.187212 | 2 | |
light_test/light_test/doctype/light_test_doctype/light_test_doctype.py | kwatkinsLexul/light_test | 0 | 6626684 | <reponame>kwatkinsLexul/light_test
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Keith and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class light_test_doctype(Document):
def validate(self):
print("... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Keith and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class light_test_doctype(Document):
def validate(self):
print("Grrrrrrayson - Validate")
def on_... | en | 0.792086 | # -*- coding: utf-8 -*- # Copyright (c) 2015, Keith and contributors # For license information, please see license.txt | 1.623706 | 2 |
homeassistant/components/netgear/const.py | andersop91/core | 4 | 6626685 | <filename>homeassistant/components/netgear/const.py
"""Netgear component constants."""
from datetime import timedelta
from homeassistant.const import Platform
DOMAIN = "netgear"
PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR]
CONF_CONSIDER_HOME = "consider_home"
DEFAULT_CONSIDER_HOME = timedelta(seconds=180... | <filename>homeassistant/components/netgear/const.py
"""Netgear component constants."""
from datetime import timedelta
from homeassistant.const import Platform
DOMAIN = "netgear"
PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR]
CONF_CONSIDER_HOME = "consider_home"
DEFAULT_CONSIDER_HOME = timedelta(seconds=180... | en | 0.480601 | Netgear component constants. # models using port 80 instead of 5000 # update method V2 models # Icons # Router (Orbi ...) # Amazon Kindle # Android Device # Android Phone # Android Tablet # Apple Airport Express # Blu-ray Player # Bridge # Cable STB # Camera # Router # DVR # Gaming Console # iMac # iPad # iPad Mini # i... | 1.970246 | 2 |
tests/engine/test_ports.py | aiace9/aiida-core | 1 | 6626686 | <filename>tests/engine/test_ports.py
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | <filename>tests/engine/test_ports.py
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | en | 0.684594 | # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ... | 2.367988 | 2 |
api_study/apps/user_operation/views.py | shidashui/django_restful_api_study | 2 | 6626687 | from django.shortcuts import render
from rest_framework import viewsets, mixins
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from user_operation.models import UserLeavingMe... | from django.shortcuts import render
from rest_framework import viewsets, mixins
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from user_operation.models import UserLeavingMe... | zh | 0.893401 | # Create your views here. 用户收藏 # queryset = UserFav.objects.all() #permission是用来做权限判断的 # IsAuthenticated:必须登陆用户; IsOwnerOrReadOnly:必须是当前登陆用户 #auth使用来做用户认证的 #搜索的字段 #只能查看当前登陆用户的收藏,不会获取所有用户的收藏 #动态选择serializer list: 获取用户留言 create: 添加留言 delete: 删除留言功能 #只能看到自己的留言 收货地址管理 list: 获取收货地... | 1.979136 | 2 |
magenta/models/drums_rnn/drums_rnn_config_flags.py | flyingleafe/magenta | 0 | 6626688 | <filename>magenta/models/drums_rnn/drums_rnn_config_flags.py<gh_stars>0
# Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | <filename>magenta/models/drums_rnn/drums_rnn_config_flags.py<gh_stars>0
# Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | en | 0.811326 | # Copyright 2020 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ... | 2.066956 | 2 |
ltr/data/processing.py | sehomi/pyCFTrackers | 0 | 6626689 | <filename>ltr/data/processing.py
import torch
import math
import numpy as np
import torchvision.transforms as transforms
from pytracking import TensorDict
import ltr.data.processing_utils as prutils
def stack_tensors(x):
if isinstance(x, (list, tuple)) and isinstance(x[0], torch.Tensor):
return torch.stac... | <filename>ltr/data/processing.py
import torch
import math
import numpy as np
import torchvision.transforms as transforms
from pytracking import TensorDict
import ltr.data.processing_utils as prutils
def stack_tensors(x):
if isinstance(x, (list, tuple)) and isinstance(x[0], torch.Tensor):
return torch.stac... | en | 0.766229 | Base class for Processing. Processing class is used to process the data returned by a dataset, before passing it through the network. For example, it can be used to crop a search region around the object, apply various data augmentations, etc. args: transform - The set of transformations to ... | 3.041396 | 3 |
desktop/core/ext-py/python-pam-1.8.4/setup.py | kokosing/hue | 5,079 | 6626690 | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
__sdesc = 'Python PAM module using ctypes, py3/py2'
setup(name = 'python-pam',
description = __sdesc,
long_description = read('README.md'),
py_modules ... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
__sdesc = 'Python PAM module using ctypes, py3/py2'
setup(name = 'python-pam',
description = __sdesc,
long_description = read('README.md'),
py_modules ... | none | 1 | 1.610497 | 2 | |
orig/models/temp_vaeold.py | IBM/oct-glaucoma-forecast | 0 | 6626691 | <gh_stars>0
import torch
import torch.nn as nn
from models.model_blocks import RNFLEncoder, RNFLDecoder, Encoder, Decoder
from models.model_blocks import VFTEncoder, VFTDecoder
#@todo implement info vae loss /mmd vae loss
class VAE(nn.Module):
def __init__(self, latent_dim, type):
super(VAE, self).__init... | import torch
import torch.nn as nn
from models.model_blocks import RNFLEncoder, RNFLDecoder, Encoder, Decoder
from models.model_blocks import VFTEncoder, VFTDecoder
#@todo implement info vae loss /mmd vae loss
class VAE(nn.Module):
def __init__(self, latent_dim, type):
super(VAE, self).__init__()
... | en | 0.308253 | #@todo implement info vae loss /mmd vae loss #self.encoder = RNFLEncoder(latent_dim=latent_dim, rnfl_imgChans=1, rnfl_fBase=32) #self.decoder = RNFLDecoder(z_size=latent_dim,rnfl_imgChans=1,rnfl_fBase=32) # return mean during inference Posterior inference :param x: :return: | 2.249984 | 2 |
public/code2.py | luisneto98/code-coliseum-web | 0 | 6626692 | <filename>public/code2.py<gh_stars>0
from enum import Enum
import sys
def converte_array(args = ['0','0','0','0','0','0','0','0','0']):
array = args[1:]
matrix = [array[0:3], array[3:6], array[6:9]]
return matrix
ESPACO_VAZIO = '0'
JOGADA_SUA = '1'
JOGADA_ADVERSARIO = '2'
'''
lOCALIZAÇÃO DAS POSIÇÕES
... | <filename>public/code2.py<gh_stars>0
from enum import Enum
import sys
def converte_array(args = ['0','0','0','0','0','0','0','0','0']):
array = args[1:]
matrix = [array[0:3], array[3:6], array[6:9]]
return matrix
ESPACO_VAZIO = '0'
JOGADA_SUA = '1'
JOGADA_ADVERSARIO = '2'
'''
lOCALIZAÇÃO DAS POSIÇÕES
... | en | 0.159662 | lOCALIZAÇÃO DAS POSIÇÕES UM | DOIS | TRÊS --------|--------|-------- QUATRO | CINCO | SEIS --------|--------|-------- SETE | OITO | NOVE | 3.135707 | 3 |
tests/models/test_deepspeech2.py | cosmoquester/speech-recognition | 6 | 6626693 | import pytest
import tensorflow as tf
from speech_recognition.models.deepspeech2 import Convolution, DeepSpeech2, Recurrent
@pytest.mark.parametrize(
"num_layers,channels,kernel_sizes,strides,batch_size,sequence_length,frequency_bins,feature_dim",
[
(1, [32], [[41, 11]], [[2, 2]], 7, 111, 33, 1),
... | import pytest
import tensorflow as tf
from speech_recognition.models.deepspeech2 import Convolution, DeepSpeech2, Recurrent
@pytest.mark.parametrize(
"num_layers,channels,kernel_sizes,strides,batch_size,sequence_length,frequency_bins,feature_dim",
[
(1, [32], [[41, 11]], [[2, 2]], 7, 111, 33, 1),
... | en | 0.651372 | # Check Shape # Check Mask for PAD # fmt: off # fmt: on | 2.582357 | 3 |
src/permifrost/core/permissions/utils/snowflake_grants.py | kouk/permifrost | 0 | 6626694 | <gh_stars>0
import re
from typing import Any, Dict, List, Optional, Set, Tuple
from permifrost.core.logger import GLOBAL_LOGGER as logger
from permifrost.core.permissions.utils.snowflake_connector import SnowflakeConnector
GRANT_ROLE_TEMPLATE = "GRANT ROLE {role_name} TO {type} {entity_name}"
REVOKE_ROLE_TEMPLATE = ... | import re
from typing import Any, Dict, List, Optional, Set, Tuple
from permifrost.core.logger import GLOBAL_LOGGER as logger
from permifrost.core.permissions.utils.snowflake_connector import SnowflakeConnector
GRANT_ROLE_TEMPLATE = "GRANT ROLE {role_name} TO {type} {entity_name}"
REVOKE_ROLE_TEMPLATE = "REVOKE ROLE... | en | 0.823698 | Initializes a grants generator, used to generate SQL for generating grants grants_to_role: a dict, mapping role to grants where role is a string and grants is a dictionary of privileges to entities. e.g. {'functional_role': {'create schema': {'database': ['database_1', 'database_2']}, .... | 2.319303 | 2 |
promgen/signals.py | kfdm/promgen | 0 | 6626695 | <gh_stars>0
# Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import logging
from functools import wraps
from django.contrib import messages
from django.core.cache import cache
from django.db.models.signals import (post_delete, post_save, pre_delete,
... | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import logging
from functools import wraps
from django.contrib import messages
from django.core.cache import cache
from django.db.models.signals import (post_delete, post_save, pre_delete,
... | en | 0.890649 | # Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE Run a signal only once Certain actions we want to run only once, at the end of processing so we wrap our function in a special decorator that uses Django's caching system to set whether we ... | 2.156438 | 2 |
src/lib/utils.py | TeleMidia/audio_reconstruction | 2 | 6626696 | <gh_stars>1-10
import cv2
import math
import numpy as np
import matplotlib.pyplot as plt
import random as rand
import os
import glob
from PIL import Image
from tqdm import tqdm
import lib.jpeg as jpg
from skimage.metrics import peak_signal_noise_ratio, normalized_root_mse
exp_chart_folder = None
model_weights_folder1 ... | import cv2
import math
import numpy as np
import matplotlib.pyplot as plt
import random as rand
import os
import glob
from PIL import Image
from tqdm import tqdm
import lib.jpeg as jpg
from skimage.metrics import peak_signal_noise_ratio, normalized_root_mse
exp_chart_folder = None
model_weights_folder1 = None
model_we... | en | 0.260723 | #print(dict_chart_data) #print(dict_chart_data["epoch"]) #print(LAST_EPOCH) # axs[0].plot(dict_chart_data["epoch"], dict_chart_data["Valid_MSE_2"], linewidth=2, color="green", label="Valid_MSE_2") # axs[0].plot(dict_chart_data["epoch"], dict_chart_data["Valid_MSE_3"], linewidth=2, color="red", label="Valid_MSE_... | 2.116137 | 2 |
InvenTree/order/models.py | Pervanovo/InvenTree | 0 | 6626697 | <reponame>Pervanovo/InvenTree
"""
Order model definitions
"""
# -*- coding: utf-8 -*-
import os
from datetime import datetime
from decimal import Decimal
from django.db import models, transaction
from django.db.models import Q, F, Sum
from django.db.models.functions import Coalesce
from django.core.validators import... | """
Order model definitions
"""
# -*- coding: utf-8 -*-
import os
from datetime import datetime
from decimal import Decimal
from django.db import models, transaction
from django.db.models import Q, F, Sum
from django.db.models.functions import Coalesce
from django.core.validators import MinValueValidator
from django... | en | 0.849212 | Order model definitions # -*- coding: utf-8 -*- Abstract model for an order. Instances of this class: - PuchaseOrder Attributes: reference: Unique order number / reference / code description: Long form description (required) notes: Extra note field (optional) creation_date... | 2.579517 | 3 |
pytorch-distributed/setup.py | Napkin-DL/my-aws-example | 0 | 6626698 | from setuptools import setup, find_packages
setup(
name='gentrl',
version='0.1',
python_requires='>=3.5.0',
packages=find_packages(),
install_requires=[
'numpy>=1.15',
'pandas>=0.23',
'scipy>=1.1.0',
'torch==1.2.0',
'molsets==0.1.3'
],
description='G... | from setuptools import setup, find_packages
setup(
name='gentrl',
version='0.1',
python_requires='>=3.5.0',
packages=find_packages(),
install_requires=[
'numpy>=1.15',
'pandas>=0.23',
'scipy>=1.1.0',
'torch==1.2.0',
'molsets==0.1.3'
],
description='G... | none | 1 | 1.299136 | 1 | |
src/data/tests/__init__.py | nsteins/crash-model | 54 | 6626699 | """
Tests for data_generation
"""
| """
Tests for data_generation
"""
| en | 0.77268 | Tests for data_generation | 0.975476 | 1 |
pureples/es_hyperneat/es_hyperneat.py | cb244/pureples | 93 | 6626700 | <filename>pureples/es_hyperneat/es_hyperneat.py<gh_stars>10-100
"""
All logic concerning ES-HyperNEAT resides here.
"""
import copy
import neat
import numpy as np
from pureples.hyperneat.hyperneat import query_cppn
from pureples.shared.visualize import draw_es
class ESNetwork:
"""
The evolvable substrate netw... | <filename>pureples/es_hyperneat/es_hyperneat.py<gh_stars>10-100
"""
All logic concerning ES-HyperNEAT resides here.
"""
import copy
import neat
import numpy as np
from pureples.hyperneat.hyperneat import query_cppn
from pureples.shared.visualize import draw_es
class ESNetwork:
"""
The evolvable substrate netw... | en | 0.880861 | All logic concerning ES-HyperNEAT resides here. The evolvable substrate network. # Number of layers in the network. Create a RecurrentNetwork using the ES-HyperNEAT approach. # Map input and output coordinates to their IDs. # Where the magic happens. # Map hidden coordinates to their IDs. # For every coordinate: # Chec... | 2.290041 | 2 |
cubejsclientasync/client.py | NarrativeScience/cubejs-client-async | 0 | 6626701 | <gh_stars>0
"""Contains the Cube.js API client"""
from datetime import datetime, timedelta
from typing import Any, Dict, Optional
import backoff
import httpx
import jwt
from .query import Query
class CubeClient:
"""Cube.js API client"""
def __init__(
self,
host: str = "http://localhost:400... | """Contains the Cube.js API client"""
from datetime import datetime, timedelta
from typing import Any, Dict, Optional
import backoff
import httpx
import jwt
from .query import Query
class CubeClient:
"""Cube.js API client"""
def __init__(
self,
host: str = "http://localhost:4000",
... | en | 0.646037 | Contains the Cube.js API client Cube.js API client Initializer Args: host: Cube.js API host base_path: Cube.js API base path secret: Secret for signing tokens. Set to None to skip authentication. load_request_timeout: Timeout in seconds to wait for load responses... | 2.616946 | 3 |
pyzoo/test/zoo/pipeline/onnx/test_model_loading.py | Polynomia/analytics-zoo | 0 | 6626702 | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | en | 0.656421 | # # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to... | 2.043176 | 2 |
tests/load_all_imports/test_load_all_imports.py | imranq2/SparkAutoMapper.FHIR | 1 | 6626703 | import importlib
import pkgutil
from typing import Any, Dict, Tuple, Union
def import_submodules(
package: Union[Any, str], recursive: bool = True
) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""Import all submodules of a module, recursively, including subpackages
from https://stackoverflow.com/questions/3... | import importlib
import pkgutil
from typing import Any, Dict, Tuple, Union
def import_submodules(
package: Union[Any, str], recursive: bool = True
) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""Import all submodules of a module, recursively, including subpackages
from https://stackoverflow.com/questions/3... | en | 0.417681 | Import all submodules of a module, recursively, including subpackages from https://stackoverflow.com/questions/3365740/how-to-import-all-submodules :param recursive: :param package: package (name or actual module) :type package: str | module :rtype: dict[str, types.ModuleType] # noinspection Mypy #... | 2.542458 | 3 |
test-drf-project/testapp/routes.py | fvlima/drf-view-profiler | 30 | 6626704 | from rest_framework import routers
from .views import TestModelViewSet, TestViewSet
app_name = "testapp"
router = routers.DefaultRouter()
router.register(r"test-viewset", TestViewSet, basename="test-viewset")
router.register(r"test-model-viewset", TestModelViewSet, basename="test-model-viewset")
urlpatterns = route... | from rest_framework import routers
from .views import TestModelViewSet, TestViewSet
app_name = "testapp"
router = routers.DefaultRouter()
router.register(r"test-viewset", TestViewSet, basename="test-viewset")
router.register(r"test-model-viewset", TestModelViewSet, basename="test-model-viewset")
urlpatterns = route... | none | 1 | 1.790397 | 2 | |
analytics/mixins.py | NicolasFlandrois/PurBeurre-Upgrade-Debug | 0 | 6626705 | from .signals import object_viewed_signal
class ObjectViewedMixin(object):
def get_context_data(self, *args, **kwargs):
context = super(ObjectViewedMixin, self).get_context_data(
*args, **kwargs)
request = self.request
instance = context.get('object')
if instance:
... | from .signals import object_viewed_signal
class ObjectViewedMixin(object):
def get_context_data(self, *args, **kwargs):
context = super(ObjectViewedMixin, self).get_context_data(
*args, **kwargs)
request = self.request
instance = context.get('object')
if instance:
... | none | 1 | 2.152002 | 2 | |
mundo 1/des031.py | Pedroluis1/python | 0 | 6626706 |
dis = float(input("\033[34mQual vai ser a distância da sua viagem em km?\033[m "))
if dis <= 200:
print(f'\033[36mo preço da passagem custará \033[33;4mR${dis*0.50}\033[m')
else:
print(f'\033[36mo preço da passagem custará \033[33;4mR${dis*0.45}\033[m')
if dis < 50:
print('\033[33;1mIIIIIHHHHH\033[31m ala ... |
dis = float(input("\033[34mQual vai ser a distância da sua viagem em km?\033[m "))
if dis <= 200:
print(f'\033[36mo preço da passagem custará \033[33;4mR${dis*0.50}\033[m')
else:
print(f'\033[36mo preço da passagem custará \033[33;4mR${dis*0.45}\033[m')
if dis < 50:
print('\033[33;1mIIIIIHHHHH\033[31m ala ... | none | 1 | 3.360762 | 3 | |
backend/project/app/extension/history/refer.py | goodyttoor/tcl_v7 | 0 | 6626707 | <gh_stars>0
from datetime import date, datetime
from typing import Optional
from sqlmodel import Field, SQLModel
class HistoryRefer(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
history_id: int
refer_id: int
state: str
created_at: datetime
updated_at: dateti... | from datetime import date, datetime
from typing import Optional
from sqlmodel import Field, SQLModel
class HistoryRefer(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
history_id: int
refer_id: int
state: str
created_at: datetime
updated_at: datetime
creat... | none | 1 | 2.492319 | 2 | |
onnxruntime/python/tools/quantization/quant_utils.py | surepassio/onnxruntime | 1 | 6626708 | import onnx
from onnx import onnx_pb as onnx_proto
from enum import Enum
from pathlib import Path
__producer__ = "onnx.quantize"
__version__ = "0.1.0"
onnx_domain = "ai.onnx"
ms_domain = "com.microsoft"
type_to_name = {
1: "FLOAT",
2: "UINT8",
3: "INT8",
4: "UINT16",
5: "INT16",
6: "INT32",
... | import onnx
from onnx import onnx_pb as onnx_proto
from enum import Enum
from pathlib import Path
__producer__ = "onnx.quantize"
__version__ = "0.1.0"
onnx_domain = "ai.onnx"
ms_domain = "com.microsoft"
type_to_name = {
1: "FLOAT",
2: "UINT8",
3: "INT8",
4: "UINT16",
5: "INT16",
6: "INT32",
... | en | 0.543494 | # Quantization mode # IntegerOps: Use IntegerOps in quantized model. Only ConvInteger and MatMulInteger ops are supported now. # QLinearOps: Use QLinearOps in quantized model. Only QLinearConv and QLinearMatMul ops are supported now. Represents a linearly quantized weight input from ONNX operators # TensorProto initial... | 2.218403 | 2 |
samples/polybench/jacobi-2d.py | Walon1998/dace | 227 | 6626709 | <reponame>Walon1998/dace
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
try:
import polybench
except ImportError:
polybench = None
N = dace.symbol('N')
tsteps = dace.symbol('tsteps')
#datatypes = [dace.float64, dace.int32, dace.float32]
datatype = dace.float64
# Datas... | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
try:
import polybench
except ImportError:
polybench = None
N = dace.symbol('N')
tsteps = dace.symbol('tsteps')
#datatypes = [dace.float64, dace.int32, dace.float32]
datatype = dace.float64
# Dataset sizes
sizes = [{
t... | en | 0.373733 | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. #datatypes = [dace.float64, dace.int32, dace.float32] # Dataset sizes #, N, tsteps #, dace.int32, dace.int32) #, N, tsteps): #, N, tsteps): | 2.025683 | 2 |
Integrations/python/test/testFigureWrapper.py | chrisabidin/deephaven-core | 55 | 6626710 | #
# Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
##############################################################################
# NOTE: the jvm should have been initialized, or this test will certainly fail
##############################################################################
import sys
... | #
# Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
##############################################################################
# NOTE: the jvm should have been initialized, or this test will certainly fail
##############################################################################
import sys
... | en | 0.775314 | # # Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending # ############################################################################## # NOTE: the jvm should have been initialized, or this test will certainly fail ############################################################################## # not part of ... | 2.28277 | 2 |
3ty/workflow_executor/workflow_executor/fastapiserver.py | DontWorry33/proc-ades | 0 | 6626711 | <filename>3ty/workflow_executor/workflow_executor/fastapiserver.py
import json
import os
import tempfile
import uvicorn
from fastapi import FastAPI, Form, File, status, Response
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
import workflow_executor
from workflow_executor impor... | <filename>3ty/workflow_executor/workflow_executor/fastapiserver.py
import json
import os
import tempfile
import uvicorn
from fastapi import FastAPI, Form, File, status, Response
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
import workflow_executor
from workflow_executor impor... | en | 0.567342 | Executes namespace preparation # image pull secrets Returns prepare status # volumeName = sanitize_k8_parameters(f"{content.serviceID}volume") # 200 done # 100 ripassa dopo # 500 error Executes workflow # {"runID": "runID-123","serviceID": "service-id-123", "prepareID":"uuid" ,"cwl":".......","inputs":".........."} # c... | 2.336862 | 2 |
iam-open-dataset/tests/services/test_bevaring_service.py | omBratteng/mottak | 0 | 6626712 | from dotenv import load_dotenv
from app.domain.models import CreateDatasetResponse
from app.services import bevaring_service
from tests.services.mock_bevaring_client import MockBevaringClient
from tests.test_utils import get_project_root
dotenv_path = get_project_root() / ".env.test"
load_dotenv(dotenv_path=dotenv_pa... | from dotenv import load_dotenv
from app.domain.models import CreateDatasetResponse
from app.services import bevaring_service
from tests.services.mock_bevaring_client import MockBevaringClient
from tests.test_utils import get_project_root
dotenv_path = get_project_root() / ".env.test"
load_dotenv(dotenv_path=dotenv_pa... | none | 1 | 2.140801 | 2 | |
acme_diags/driver/polar_driver.py | zshaheen/e3sm_diags | 0 | 6626713 | from __future__ import print_function
import os
import cdms2
import MV2
import acme_diags
from acme_diags.plot import plot
from acme_diags.derivations import acme
from acme_diags.metrics import rmse, corr, min_cdms, max_cdms, mean
from acme_diags.driver import utils
def create_metrics(ref, test, ref_regrid, test_reg... | from __future__ import print_function
import os
import cdms2
import MV2
import acme_diags
from acme_diags.plot import plot
from acme_diags.derivations import acme
from acme_diags.metrics import rmse, corr, min_cdms, max_cdms, mean
from acme_diags.driver import utils
def create_metrics(ref, test, ref_regrid, test_reg... | en | 0.881214 | Creates the mean, max, min, rmse, corr in a dictionary # Get the name of the data, appended with the years averaged. # Get land/ocean fraction for masking. # Special case, cdms didn't properly convert mask with fill value # -999.0, filed issue with Denis. # This is cdms2 fix for bad mask, Denis' fix should fix this. # ... | 2.282217 | 2 |
TCGAdnloader/downloader.py | jingxinfu/TCGAdnloader | 2 | 6626714 | #!/usr/bin/env python3
import subprocess, os,time,gzip
import pandas as pd
import numpy as np
from functools import reduce
from .convertor import mergeToSample, calTNzcore, rmEntrez, tpmToFpkm, mapEm2Gene, formatClin, pick,formatDrug
from .outformat import storeData
import requests,json,re,io
from .setting import CLIN... | #!/usr/bin/env python3
import subprocess, os,time,gzip
import pandas as pd
import numpy as np
from functools import reduce
from .convertor import mergeToSample, calTNzcore, rmEntrez, tpmToFpkm, mapEm2Gene, formatClin, pick,formatDrug
from .outformat import storeData
import requests,json,re,io
from .setting import CLIN... | en | 0.584629 | #!/usr/bin/env python3 API for download files from GDC Intialize instance parameters Parameters ---------- cancer : str Cancer type parental_dir : str Path to store datas data_endpt : str, optional [Endpoint for files id searching] (th... | 2.149518 | 2 |
netflix_notify/management/commands/sync_titles.py | mikeengland/netflix-notify | 1 | 6626715 | import logging
from django.core.management.base import BaseCommand
from netflix_notify.enums import Regions
from netflix_notify.models import (Title,
SyncLog)
from netflix_notify.scraper import Scraper
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'S... | import logging
from django.core.management.base import BaseCommand
from netflix_notify.enums import Regions
from netflix_notify.models import (Title,
SyncLog)
from netflix_notify.scraper import Scraper
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'S... | en | 0.891975 | # TODO Add option to sync a specific Netflix region Retrieve the titles from the API, post-process them and store them in the database, ensuring any existing but now missing titles are set as inactive. | 2.206957 | 2 |
CDSB_series/split/script-split.py | WFDetector/WFDetection | 0 | 6626716 | import subprocess
from os.path import join
original = "../../defenses/results/"
split = "../xgboost/scores/"
# undefended
# targets = [
# "mergepad_0701_2018/",
# "mergepad_0701_2019/",
# "mergepad_0701_2020/",
# "mergepad_0701_2021/",
# "mergepad_0701_2022/",
# "mergepad_0701_2023/",
# "mergepad_0701_2024/",
# "merg... | import subprocess
from os.path import join
original = "../../defenses/results/"
split = "../xgboost/scores/"
# undefended
# targets = [
# "mergepad_0701_2018/",
# "mergepad_0701_2019/",
# "mergepad_0701_2020/",
# "mergepad_0701_2021/",
# "mergepad_0701_2022/",
# "mergepad_0701_2023/",
# "mergepad_0701_2024/",
# "merg... | en | 0.35882 | # undefended # targets = [ # "mergepad_0701_2018/", # "mergepad_0701_2019/", # "mergepad_0701_2020/", # "mergepad_0701_2021/", # "mergepad_0701_2022/", # "mergepad_0701_2023/", # "mergepad_0701_2024/", # "mergepad_0701_2025/", # "mergepad_0701_2026/", # "mergepad_0701_2027/", # "mergepad_0701_2028/", # "mergepad_0701_2... | 1.882114 | 2 |
developer_manual/examples/python/login.py | hope15/documentation | 154 | 6626717 | import owncloud
oc = owncloud.Client('https://your.owncloud.install.com/owncloud/')
oc.login('msetter', 'Zaex7Thex2di')
oc.list('/')
oc.logout()
| import owncloud
oc = owncloud.Client('https://your.owncloud.install.com/owncloud/')
oc.login('msetter', 'Zaex7Thex2di')
oc.list('/')
oc.logout()
| none | 1 | 1.723353 | 2 | |
129. Sum Root to Leaf Numbers.py | MapleLove2014/leetcode | 1 | 6626718 | # Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def sumNumbers(self, root: TreeNode) -> int:
if not root:
return 0
def doit(root, prefix)... | # Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def sumNumbers(self, root: TreeNode) -> int:
if not root:
return 0
def doit(root, prefix)... | en | 0.652542 | # Definition for a binary tree node. | 3.663431 | 4 |
Testmode/mnist-digit_recognition.py | xiaokamikami/TI_MedicineCar-R | 0 | 6626719 | <filename>Testmode/mnist-digit_recognition.py
from fpioa_manager import *
import os, Maix, lcd, image, sensor, gc, time
from Maix import FPIOA, GPIO
import KPU as kpu
import gc
lcd.init(type=1,freq=15000000,width=240,height=240,color=(0,0,0))
lcd.rotation(3)
lcd.clear(0,0,0)
lcd.draw_string(20,20, "CocoRobo X", lcd.W... | <filename>Testmode/mnist-digit_recognition.py
from fpioa_manager import *
import os, Maix, lcd, image, sensor, gc, time
from Maix import FPIOA, GPIO
import KPU as kpu
import gc
lcd.init(type=1,freq=15000000,width=240,height=240,color=(0,0,0))
lcd.rotation(3)
lcd.clear(0,0,0)
lcd.draw_string(20,20, "CocoRobo X", lcd.W... | en | 0.381409 | #设置摄像头镜像 #设置摄像头翻转 # img_boot = image.Image("/sd/images/boot_digit.jpg") # lcd.display(img_boot, oft=(0,0)) # time.sleep(2) #task = kpu.load("/sd/model/mnist.kmodel") #load model from flash address 0x200000 #task_mnist = kpu.load("/sd/mnist.kmodel") #resize to mnist input 28x28 #invert picture as mnist need #p... | 2.529453 | 3 |
aldryn_newsblog_extra_plugins/utils.py | febsn/aldryn_newsblog_extra_plugins | 1 | 6626720 | <filename>aldryn_newsblog_extra_plugins/utils.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
import six
def get_additional_styles(extra_name=False):
"""
Get additional styles choices from settings
Copied from aldryn-events.utils
"""
... | <filename>aldryn_newsblog_extra_plugins/utils.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
import six
def get_additional_styles(extra_name=False):
"""
Get additional styles choices from settings
Copied from aldryn-events.utils
"""
... | en | 0.81618 | # -*- coding: utf-8 -*- Get additional styles choices from settings Copied from aldryn-events.utils # Happened on aldryn to choice be a tuple with two # empty strings and this break the deployment. To avoid that # kind of issue if something fais we just ignore. | 2.057306 | 2 |
geradorcpf.py | dimagela29/Python-POO | 1 | 6626721 | <reponame>dimagela29/Python-POO
from random import randint
def gera_cpf():
numero = str(randint(100000000, 999999999))
novo_cpf = numero # 9 números aleatórios
reverso = 10 # Contador reverso
total = 0 # O total das multiplicações
# Loop do CPF
for index in range(19):
if index > 8... | from random import randint
def gera_cpf():
numero = str(randint(100000000, 999999999))
novo_cpf = numero # 9 números aleatórios
reverso = 10 # Contador reverso
total = 0 # O total das multiplicações
# Loop do CPF
for index in range(19):
if index > 8: # Primeiro índice vai de 0 a ... | pt | 0.952595 | # 9 números aleatórios # Contador reverso # O total das multiplicações # Loop do CPF # Primeiro índice vai de 0 a 9, # São os 9 primeiros digitos do CPF # Valor total da multiplicação # Decrementa o contador reverso # Se o digito for > que 9 o valor é 0 # Zera o total # Concatena o digito gerado no novo cpf | 3.275203 | 3 |
tests/integration/test_graph.py | ewuerger/dbwily | 0 | 6626722 | import sys
import tempfile
from unittest.mock import patch
import wily.__main__ as main
from click.testing import CliRunner
_path = "src\\test.py" if sys.platform == "win32" else "src/test.py"
PATCHED_ENV = {
"BROWSER": "echo %s",
"LC_ALL": "C.UTF-8",
"LANG": "C.UTF-8",
"HOME": tempfile.gettempdir()... | import sys
import tempfile
from unittest.mock import patch
import wily.__main__ as main
from click.testing import CliRunner
_path = "src\\test.py" if sys.platform == "win32" else "src/test.py"
PATCHED_ENV = {
"BROWSER": "echo %s",
"LC_ALL": "C.UTF-8",
"LANG": "C.UTF-8",
"HOME": tempfile.gettempdir()... | en | 0.847364 | Test the graph feature Test the graph feature Test the graph feature with shorthand metric Test the graph feature Test the graph feature Test the graph feature Test the graph feature with multiple metrics Test the graph feature with multiple metrics Test the graph feature with multiple metrics Test the graph feature wi... | 2.282074 | 2 |
datasource/Climate Scrapper.py | mqchau/citymatch | 0 | 6626723 |
# coding: utf-8
# In[1]:
import json
from bs4 import BeautifulSoup
import requests
from pprint import pprint
import re
import html5lib
states = {
'Illinois':'IL',
'Kansas':'KS',
'South Dakota':'SD',
'Idaho':'ID',
'South Carolina':'SC',
'Ohio':'OH',
'Wyoming':'... |
# coding: utf-8
# In[1]:
import json
from bs4 import BeautifulSoup
import requests
from pprint import pprint
import re
import html5lib
states = {
'Illinois':'IL',
'Kansas':'KS',
'South Dakota':'SD',
'Idaho':'ID',
'South Carolina':'SC',
'Ohio':'OH',
'Wyoming':'... | en | 0.310787 | # coding: utf-8 # In[1]: # print(url) # break # print(table.find('td').text) # print(data) # print('precip',precip) # print('temphigh',temp_high) # print('templow',temp_low) # url = 'http://www.weatherbase.com/weathe... | 2.537077 | 3 |
set1/p1_2_1.py | matheuspercario/python-mit | 0 | 6626724 | # PYTHON - MIT - UNICAMP
# =============================================================================
# Created By : <NAME>
# Created Date : February 2nd, 2021
# =============================================================================
numbers = [2, 7, 3, 9, 13]
_sum = 0
# Verificar se a lista está vazia
if ... | # PYTHON - MIT - UNICAMP
# =============================================================================
# Created By : <NAME>
# Created Date : February 2nd, 2021
# =============================================================================
numbers = [2, 7, 3, 9, 13]
_sum = 0
# Verificar se a lista está vazia
if ... | pt | 0.265669 | # PYTHON - MIT - UNICAMP # ============================================================================= # Created By : <NAME> # Created Date : February 2nd, 2021 # ============================================================================= # Verificar se a lista está vazia # Iterando sobre a lista e somando valore... | 3.873895 | 4 |
setup.py | jamesabel/sundry | 2 | 6626725 | import os
from setuptools import setup
from sundry.__version__ import __version__, __title__, __author__, __author_email__, __url__, __download_url__, __description__
readme_file_path = os.path.join(__title__, "readme.rst")
with open(readme_file_path, encoding="utf-8") as f:
long_description = "\n" + f.read()
... | import os
from setuptools import setup
from sundry.__version__ import __version__, __title__, __author__, __author_email__, __url__, __download_url__, __description__
readme_file_path = os.path.join(__title__, "readme.rst")
with open(readme_file_path, encoding="utf-8") as f:
long_description = "\n" + f.read()
... | none | 1 | 1.317501 | 1 | |
products/models.py | minaeid90/ecommerce | 0 | 6626726 | <gh_stars>0
from django.db import models
from django.db.models.signals import pre_save, post_save
import random
import os
from ecommerce.utils import unique_slug_generator
class ProductQuerySet(models.query.QuerySet):
def active(self):
return self.filter(active=True)
class ProductManager(models.M... | from django.db import models
from django.db.models.signals import pre_save, post_save
import random
import os
from ecommerce.utils import unique_slug_generator
class ProductQuerySet(models.query.QuerySet):
def active(self):
return self.filter(active=True)
class ProductManager(models.Manager):
... | none | 1 | 2.049926 | 2 | |
8.Deques/python/LinkedDeque.py | unclexo/data-structures-and-algorithms | 2 | 6626727 | class LinkedDeque:
class _Node:
__slots__ = '_element', '_next'
def __init__(self, element, next_node):
self._element = element
self._next = next_node
def __init__(self):
self._head = None
self._tail = None
self._size = 0
def __len__(self):... | class LinkedDeque:
class _Node:
__slots__ = '_element', '_next'
def __init__(self, element, next_node):
self._element = element
self._next = next_node
def __init__(self):
self._head = None
self._tail = None
self._size = 0
def __len__(self):... | en | 0.374752 | Returns (but do not remove) the first element from the deque Returns (but do not remove) the last element from the deque # print(d.remove_right() + ' ' + d.remove_left()) # # print(d.first()) # print(d.last()) # print(len(d)) | 3.888508 | 4 |
hook.py | Abriko/letsencrypt-alidns-hook | 3 | 6626728 | #!/usr/bin/env python
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from future import standard_library
import dns.exception
import dns.resolver
import logging
import os
import requests
... | #!/usr/bin/env python
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from future import standard_library
import dns.exception
import dns.resolver
import logging
import os
import requests
... | en | 0.591722 | #!/usr/bin/env python # # Enable verified HTTPS requests on older Pythons # http://urllib3.readthedocs.org/en/latest/security.html # for ali api signature # https://help.aliyun.com/document_detail/29772.html AddDomainRecord # give it 10 seconds to settle down and avoid nxdomain caching # https://help.aliyun.com/documen... | 2.318615 | 2 |
pox/g2_static.py | reservoirlabs/G2-Mininet | 2 | 6626729 | <gh_stars>1-10
"""
G2_RIGHTS.
An L3 switch based on static routing.
This module creates a POX controller which reads static routing configuration from a file.
Accordingly, each switch that connects to this controller will receive both IP and ARP flows table entries.
Therefore, no routing request comes to the controll... | """
G2_RIGHTS.
An L3 switch based on static routing.
This module creates a POX controller which reads static routing configuration from a file.
Accordingly, each switch that connects to this controller will receive both IP and ARP flows table entries.
Therefore, no routing request comes to the controller for known pa... | en | 0.842453 | G2_RIGHTS. An L3 switch based on static routing. This module creates a POX controller which reads static routing configuration from a file. Accordingly, each switch that connects to this controller will receive both IP and ARP flows table entries. Therefore, no routing request comes to the controller for known paths.... | 2.904029 | 3 |
homeworks/SDIRK/templates/stabdomSDIRK.py | kryo4096/NPDECODES | 15 | 6626730 | <reponame>kryo4096/NPDECODES<gh_stars>10-100
import sys
import matplotlib.pyplot as plt
import matplotlib.colors as col
import numpy as np
output_file = str(sys.argv[1])
if len(sys.argv) == 3:
input_gamma = sys.argv[2]
else:
input_gamma = 1.0;
# Stability function
S = lambda z, gamma=1.0: (1.0 + z * (1.0 - 2... | import sys
import matplotlib.pyplot as plt
import matplotlib.colors as col
import numpy as np
output_file = str(sys.argv[1])
if len(sys.argv) == 3:
input_gamma = sys.argv[2]
else:
input_gamma = 1.0;
# Stability function
S = lambda z, gamma=1.0: (1.0 + z * (1.0 - 2.0 * gamma) + z**2 * (gamma**2 - 2.0 * gamma ... | en | 0.484531 | # Stability function # Compute F(x) on a meshgrid # Contour plot distinguishes absS < 1 and absS > 1 #fig.colorbar(cs1) | 2.484663 | 2 |
setup.py | jpcw/mr.bob | 0 | 6626731 | # -*- coding: utf-8 -*-
import os
import sys
import codecs
from setuptools import setup
from setuptools import find_packages
install_requires = [
'setuptools',
'six>=1.2.0', # 1.1.0 release doesn't have six.moves.input
]
if (3,) < sys.version_info < (3, 3):
# Jinja 2.7 drops Python 3.2 compat.
inst... | # -*- coding: utf-8 -*-
import os
import sys
import codecs
from setuptools import setup
from setuptools import find_packages
install_requires = [
'setuptools',
'six>=1.2.0', # 1.1.0 release doesn't have six.moves.input
]
if (3,) < sys.version_info < (3, 3):
# Jinja 2.7 drops Python 3.2 compat.
inst... | en | 0.557488 | # -*- coding: utf-8 -*- # 1.1.0 release doesn't have six.moves.input # Jinja 2.7 drops Python 3.2 compat. # NOQA # NOQA # NOQA [console_scripts] mrbob = mrbob.cli:main | 1.921828 | 2 |
0000_examples/gelsight/rbt_con/plan.py | Photon26/wrs-main_0614 | 0 | 6626732 | import motion.optimization_based.incremental_nik as inik
import visualization.panda.world as wd
import modeling.geometric_model as gm
import modeling.collision_model as cm
import robot_sim.robots.ur3_dual.ur3_dual as ur3d
import numpy as np
import math
import basis.robot_math as rm
if __name__ == '__main__':
base ... | import motion.optimization_based.incremental_nik as inik
import visualization.panda.world as wd
import modeling.geometric_model as gm
import modeling.collision_model as cm
import robot_sim.robots.ur3_dual.ur3_dual as ur3d
import numpy as np
import math
import basis.robot_math as rm
if __name__ == '__main__':
base ... | en | 0.287116 | # robot_s # base.run() | 2.043562 | 2 |
pure_sklearn/ensemble/tests/test_extra_trees.py | ashetty1-m/pure-predict | 62 | 6626733 | <filename>pure_sklearn/ensemble/tests/test_extra_trees.py
import warnings
import numpy as np
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.datasets import load_iris
from pure_sklearn.map import convert_estimator
from pure_sklearn.utils import shape
METHODS = ["predict", "predict_proba", "predict_log... | <filename>pure_sklearn/ensemble/tests/test_extra_trees.py
import warnings
import numpy as np
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.datasets import load_iris
from pure_sklearn.map import convert_estimator
from pure_sklearn.utils import shape
METHODS = ["predict", "predict_proba", "predict_log... | none | 1 | 2.21053 | 2 | |
ClassificationLossMinimizeUsingBackProp.py | JunzuoWan/Add-subtraction-multiplication-and-division | 0 | 6626734 | # Back (retro) Propagation
# This python function shows how to implement back (retro) propagation
# in a classification model.
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
# Create graph and start a session
sess = tf.Session()
# This is a classifica... | # Back (retro) Propagation
# This python function shows how to implement back (retro) propagation
# in a classification model.
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
# Create graph and start a session
sess = tf.Session()
# This is a classifica... | en | 0.583028 | # Back (retro) Propagation # This python function shows how to implement back (retro) propagation # in a classification model. # Create graph and start a session # This is a classification example. # There are 200 values of the corresponding output index # We will fit the binary classification model: # If sigmoid(x+b) ... | 3.984862 | 4 |
src/waldur_rancher/handlers.py | geant-multicloud/MCMS-mastermind | 26 | 6626735 | import logging
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from waldur_core.core.models import StateMixin
from . import models, tasks
logger = logging.getLogger(__name__)
def notify_create_user(sender, instance,... | import logging
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from waldur_core.core.models import StateMixin
from . import models, tasks
logger = logging.getLogger(__name__)
def notify_create_user(sender, instance,... | none | 1 | 1.870868 | 2 | |
rmgpy/data/test_data/thermo/groups/radical.py | tza0035/RMG-Py | 250 | 6626736 | #!/usr/bin/env python
# encoding: utf-8
name = "<NAME>"
shortDesc = ""
longDesc = """
"""
entry(
index = 0,
label = "Radical",
group = "OR{RJ, RJ2_singlet}",
thermo = 'RJ',
shortDesc = """""",
longDesc =
"""
""",
)
entry(
index = 1,
label = "RJ",
group =
"""
1 * R u1
""",
t... | #!/usr/bin/env python
# encoding: utf-8
name = "<NAME>"
shortDesc = ""
longDesc = """
"""
entry(
index = 0,
label = "Radical",
group = "OR{RJ, RJ2_singlet}",
thermo = 'RJ',
shortDesc = """""",
longDesc =
"""
""",
)
entry(
index = 1,
label = "RJ",
group =
"""
1 * R u1
""",
t... | en | 0.29682 | #!/usr/bin/env python # encoding: utf-8 1 * R u1 1 * C u1 1 * Cs u1 1 * O u1 1 * R u2 L1: Radical L2: RJ L3: CJ L4: CsJ L3: OJ L2: RJ2_triplet | 1.774192 | 2 |
src/Python/Rendering/MotionBlur.py | sankhesh/vtk-examples | 0 | 6626737 | #!/usr/bin/env python
import vtk
def main():
fileName = get_program_parameters()
colors = vtk.vtkNamedColors()
colors.SetColor('A1Diff', [255, 204, 77, 255])
colors.SetColor('A2Amb', [51, 51, 255, 255])
colors.SetColor('A2Diff', [51, 255, 204, 255])
colors.SetColor('A3Amb', [128, 166, 255, ... | #!/usr/bin/env python
import vtk
def main():
fileName = get_program_parameters()
colors = vtk.vtkNamedColors()
colors.SetColor('A1Diff', [255, 204, 77, 255])
colors.SetColor('A2Amb', [51, 51, 255, 255])
colors.SetColor('A2Diff', [51, 255, 204, 255])
colors.SetColor('A3Amb', [128, 166, 255, ... | en | 0.596015 | #!/usr/bin/env python # create three models # create the basic VTK render steps # Tell the renderer to use our render pass pipeline. | 2.007326 | 2 |
0015.3Sum/test.py | zhlinh/leetcode | 0 | 6626738 | <filename>0015.3Sum/test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
inpt = [0, 0, 0, 0]
sol = Solution()
result = sol.threeSum(inpt)
print(result)
| <filename>0015.3Sum/test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
inpt = [0, 0, 0, 0]
sol = Solution()
result = sol.threeSum(inpt)
print(result)
| en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.786384 | 3 |
examples/Classify/MNistViewer.py | parrisma/TicTacToe-DeepLearning | 1 | 6626739 | <reponame>parrisma/TicTacToe-DeepLearning
import unittest
from random import randint
from typing import List
import matplotlib as mpl
import numpy as np
from matplotlib import pyplot
from examples.Classify import MNistLoader
class MNistViewer:
@classmethod
def view_img(cls, image=List[float]) -> None:
... | import unittest
from random import randint
from typing import List
import matplotlib as mpl
import numpy as np
from matplotlib import pyplot
from examples.Classify import MNistLoader
class MNistViewer:
@classmethod
def view_img(cls, image=List[float]) -> None:
fig = pyplot.figure()
ax = fig.... | en | 0.821535 | # # Unit Tests. # # # Test Image Load. # # # Execute the UnitTests. # | 2.967733 | 3 |
mayan/apps/sources/__init__.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 2 | 6626740 | <gh_stars>1-10
default_app_config = 'mayan.apps.sources.apps.SourcesApp'
| default_app_config = 'mayan.apps.sources.apps.SourcesApp' | none | 1 | 1.037804 | 1 | |
examples/scope/simple-class.py | brownplt/lambda-py | 25 | 6626741 | x = 5
class C(object):
x = 10
def f(self):
return x
y = x + 10
c = C()
___assertEqual(c.y, 20)
___assertEqual(c.f(), 5)
| x = 5
class C(object):
x = 10
def f(self):
return x
y = x + 10
c = C()
___assertEqual(c.y, 20)
___assertEqual(c.f(), 5)
| none | 1 | 3.293584 | 3 | |
sdk/python/pulumi_aws/apigateway/base_path_mapping.py | mdop-wh/pulumi-aws | 0 | 6626742 | <gh_stars>0
# 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, Tuple, Union
fro... | # 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, Tuple, Union
from .. import ... | en | 0.757857 | # 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! *** Connects a custom domain name registered via `apigateway.DomainName` with a deployed API so that its methods can be called via t... | 1.871021 | 2 |
src/creasepattern/main.py | qurben/creasepattern | 0 | 6626743 | import os
import sys
from creasepattern import cp2png, cp2svg, opx2png, orh2png, orh2svg, opx2svg, orh2cp, opx2cp
def main():
if len(sys.argv) != 3:
print("""Usage:
{0} creasepattern.cp image.png
{0} creasepattern.cp image.svg""".format(os.path.basename(sys.argv[0])))
exit()
... | import os
import sys
from creasepattern import cp2png, cp2svg, opx2png, orh2png, orh2svg, opx2svg, orh2cp, opx2cp
def main():
if len(sys.argv) != 3:
print("""Usage:
{0} creasepattern.cp image.png
{0} creasepattern.cp image.svg""".format(os.path.basename(sys.argv[0])))
exit()
... | te | 0.09092 | Usage: {0} creasepattern.cp image.png {0} creasepattern.cp image.svg | 2.652417 | 3 |
cypher_1.py | kilbyjmichael/More-Bad-Crypto | 4 | 6626744 | <reponame>kilbyjmichael/More-Bad-Crypto<filename>cypher_1.py
#!/usr/bin/python
'''Inspired by my man Ceasar.'''
from string import maketrans
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
secret = raw_input("Enter your plaintext -> ")
key = raw_input("Enter your key (1-25, 27-51) -> ")
key = int(... | #!/usr/bin/python
'''Inspired by my man Ceasar.'''
from string import maketrans
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
secret = raw_input("Enter your plaintext -> ")
key = raw_input("Enter your key (1-25, 27-51) -> ")
key = int(key)
def cypher_make(key):
replace = alphabet[key:] + al... | en | 0.6837 | #!/usr/bin/python Inspired by my man Ceasar. | 3.734631 | 4 |
spinup/algos/pytorch/ddpg/core.py | MLRG-CEFET-RJ/DRL-ALM | 3 | 6626745 | <reponame>MLRG-CEFET-RJ/DRL-ALM
import numpy as np
import pandas as pd
import gym
from gym import spaces
from scipy.stats import chi2
import torch
import torch.nn as nn
def combined_shape(length, shape=None):
if shape is None:
return (length,)
return (length, shape) if np.isscalar(shape) else (length... | import numpy as np
import pandas as pd
import gym
from gym import spaces
from scipy.stats import chi2
import torch
import torch.nn as nn
def combined_shape(length, shape=None):
if shape is None:
return (length,)
return (length, shape) if np.isscalar(shape) else (length, *shape)
def mlp(sizes, activa... | en | 0.848047 | # self.pi = mlp(pi_sizes, activation, nn.Tanh) original entry # Changed for ALMEnv # Return output from network scaled to action space limits. # Critical to ensure q has right shape. # build policy and value functions ALM Environment This environment is not part of the original OpenAI SpinningUp package It's been inclu... | 2.321977 | 2 |
scripts/gn_lib/gn_io/trace.py | HiTMonitor/ginan | 0 | 6626746 | <reponame>HiTMonitor/ginan<gh_stars>0
'''TRACE file parser. Note the separate functions for values and residuals'''
import logging as _logging
import os as _os
import re as _re
from io import BytesIO as _BytesIO
import numpy as _np
import pandas as _pd
from ..gn_const import J2000_ORIGIN as _J2000_ORIGIN
from ..gn_co... | '''TRACE file parser. Note the separate functions for values and residuals'''
import logging as _logging
import os as _os
import re as _re
from io import BytesIO as _BytesIO
import numpy as _np
import pandas as _pd
from ..gn_const import J2000_ORIGIN as _J2000_ORIGIN
from ..gn_const import PRN_CATEGORY, STATE_TYPES_C... | en | 0.77435 | TRACE file parser. Note the separate functions for values and residuals # 'States', 'Residuals' #path2bytes passes through bytes # needs +1 not to start with '\n' # needs +2 to remove ' +' # type:ignore # dropping ONE type # type:ignore # may be removed in the future when the pivot is removed from PEA # to get max_ind ... | 2.471051 | 2 |
perceptron/tokenizer.py | masterhead/amazon-food-review-perceptron | 0 | 6626747 | <filename>perceptron/tokenizer.py
from string import punctuation, digits
#pragma: coderesponse template
def extract_words(input_string):
"""
Helper function for bag_of_words()
Inputs a text string
Returns a list of lowercase words in the string.
Punctuation and digits are separated out into their o... | <filename>perceptron/tokenizer.py
from string import punctuation, digits
#pragma: coderesponse template
def extract_words(input_string):
"""
Helper function for bag_of_words()
Inputs a text string
Returns a list of lowercase words in the string.
Punctuation and digits are separated out into their o... | en | 0.459542 | #pragma: coderesponse template Helper function for bag_of_words() Inputs a text string Returns a list of lowercase words in the string. Punctuation and digits are separated out into their own words. #pragma: coderesponse end #pragma: coderesponse template Inputs a list of string reviews Returns a dictio... | 3.698408 | 4 |
lib/JumpScale/tools/telegram/handlers/DemoHandlerMS1.py | Jumpscale/jumpscale_core8 | 8 | 6626748 | from datetime import datetime
from JumpScale import j
class DemoHandlerMS1:
def __init__(self):
pass
def on_text(self, tg, message):
j.application.break_into_jshell("DEBUG NOW kkk")
# markup={}
# markup["force_reply"]=True
# tg.send_message(message.chat.id, "this ... | from datetime import datetime
from JumpScale import j
class DemoHandlerMS1:
def __init__(self):
pass
def on_text(self, tg, message):
j.application.break_into_jshell("DEBUG NOW kkk")
# markup={}
# markup["force_reply"]=True
# tg.send_message(message.chat.id, "this ... | en | 0.177729 | # markup={} # markup["force_reply"]=True # tg.send_message(message.chat.id, "this is me",reply_to_message_id=None,reply_markup=j.data.serializer.json.dumps(markup)) | 2.296342 | 2 |
scripts/extractHMMR_fasta.py | glaunay/nox-analysis | 0 | 6626749 | import gzip
import re
import sys
### Extract protein Hit from a profile scan against a protein DB
hmmrResultFile = sys.argv[1]
fastaVolumeFile = sys.argv[2]
rBool = False
lBool = False
matchID = []
# Extract sequence name that were annotated by HMMR
with open(hmmrResultFile,'r') as f:
for l in f:
if l.s... | import gzip
import re
import sys
### Extract protein Hit from a profile scan against a protein DB
hmmrResultFile = sys.argv[1]
fastaVolumeFile = sys.argv[2]
rBool = False
lBool = False
matchID = []
# Extract sequence name that were annotated by HMMR
with open(hmmrResultFile,'r') as f:
for l in f:
if l.s... | en | 0.884233 | ### Extract protein Hit from a profile scan against a protein DB # Extract sequence name that were annotated by HMMR #print len(matchID) #print '#No protein detected by HMMR' # Write the content of the multifasta volumes thaht correspond to the aforextracted names #print a[0] # delte last char '\n', automatically added... | 2.68151 | 3 |
lib/pyfrc/cli/cli_profiler.py | virtuald/pyfrc | 0 | 6626750 | <reponame>virtuald/pyfrc
import subprocess
import sys
def run(run_fn, file_location):
try:
import cProfile
except ImportError:
print("Error importing cProfile module for profiling, your python interpreter may not support profiling\n", file=sys.stderr)
return 1
# construct the ar... | import subprocess
import sys
def run(run_fn, file_location):
try:
import cProfile
except ImportError:
print("Error importing cProfile module for profiling, your python interpreter may not support profiling\n", file=sys.stderr)
return 1
# construct the arguments to run the profile... | en | 0.473522 | # construct the arguments to run the profiler | 2.665057 | 3 |