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
examples/scripts/flopy_lake_example.py
andrewcalderwood/flopy
351
10400
import os import sys import numpy as np import matplotlib.pyplot as plt import flopy def run(): workspace = os.path.join("lake") # make sure workspace directory exists if not os.path.exists(workspace): os.makedirs(workspace) fext = "png" narg = len(sys.argv) iarg = 0 if narg > 1:...
import os import sys import numpy as np import matplotlib.pyplot as plt import flopy def run(): workspace = os.path.join("lake") # make sure workspace directory exists if not os.path.exists(workspace): os.makedirs(workspace) fext = "png" narg = len(sys.argv) iarg = 0 if narg > 1:...
en
0.849596
# make sure workspace directory exists # save the starting path # change to the working directory # We are creating a square model with a specified head equal to `h1` along all boundaries. # The head at the cell in the center in the top layer is fixed to `h2`. First, set the name # of the model and the parameters of th...
2.857816
3
P2/Caso2/clustering.py
Ocete/Inteligenica-de-Negocio
0
10401
# -*- coding: utf-8 -*- ''' Documentación sobre clustering en Python: http://scikit-learn.org/stable/modules/clustering.html http://www.learndatasci.com/k-means-clustering-algorithms-python-intro/ http://hdbscan.readthedocs.io/en/latest/comparing_clustering_algorithms.html https://joernhees.de...
# -*- coding: utf-8 -*- ''' Documentación sobre clustering en Python: http://scikit-learn.org/stable/modules/clustering.html http://www.learndatasci.com/k-means-clustering-algorithms-python-intro/ http://hdbscan.readthedocs.io/en/latest/comparing_clustering_algorithms.html https://joernhees.de...
es
0.488537
# -*- coding: utf-8 -*- Documentación sobre clustering en Python: http://scikit-learn.org/stable/modules/clustering.html http://www.learndatasci.com/k-means-clustering-algorithms-python-intro/ http://hdbscan.readthedocs.io/en/latest/comparing_clustering_algorithms.html https://joernhees.de/blog/2015...
3.499292
3
signal_processing/ecg_preproc.py
DeepPSP/cpsc2020
1
10402
""" preprocess of (single lead) ecg signal: band pass --> remove baseline --> find rpeaks --> denoise (mainly deal with motion artefact) TODO: 1. motion artefact detection, and slice the signal into continuous (no motion artefact within) segments 2. to add References: ----------- [1] https://github...
""" preprocess of (single lead) ecg signal: band pass --> remove baseline --> find rpeaks --> denoise (mainly deal with motion artefact) TODO: 1. motion artefact detection, and slice the signal into continuous (no motion artefact within) segments 2. to add References: ----------- [1] https://github...
en
0.667407
preprocess of (single lead) ecg signal: band pass --> remove baseline --> find rpeaks --> denoise (mainly deal with motion artefact) TODO: 1. motion artefact detection, and slice the signal into continuous (no motion artefact within) segments 2. to add References: ----------- [1] https://github.com...
2.390558
2
ocaml/bootstrap.bzl
mobileink/obazl
0
10403
<filename>ocaml/bootstrap.bzl<gh_stars>0 ## mv to //:WORKSPACE.bzl ocaml_configure load("//ocaml/_bootstrap:ocaml.bzl", _ocaml_configure = "ocaml_configure") # load("//ocaml/_bootstrap:obazl.bzl", _obazl_configure = "obazl_configure") load("//ocaml/_rules:ocaml_repository.bzl" , _ocaml_repository = "ocaml_reposi...
<filename>ocaml/bootstrap.bzl<gh_stars>0 ## mv to //:WORKSPACE.bzl ocaml_configure load("//ocaml/_bootstrap:ocaml.bzl", _ocaml_configure = "ocaml_configure") # load("//ocaml/_bootstrap:obazl.bzl", _obazl_configure = "obazl_configure") load("//ocaml/_rules:ocaml_repository.bzl" , _ocaml_repository = "ocaml_reposi...
en
0.351615
## mv to //:WORKSPACE.bzl ocaml_configure # load("//ocaml/_bootstrap:obazl.bzl", _obazl_configure = "obazl_configure") # load("//ocaml/_rules:opam_configuration.bzl" , _opam_configuration = "opam_configuration") # load("//ocaml/_toolchains:ocaml_toolchains.bzl", # _ocaml_toolchain = "ocaml_toolchain", # _...
1.254656
1
tsts.py
tedtroxell/metrician
0
10404
<filename>tsts.py from metrician.explainations.tests import *
<filename>tsts.py from metrician.explainations.tests import *
none
1
0.935181
1
simple/facenet.py
taflahi/facenet
5
10405
<reponame>taflahi/facenet import tensorflow as tf from .. src.align import detect_face from .. src import facenet from .. simple import download_model import sys import os from os.path import expanduser import copy import cv2 import numpy as np from scipy import spatial minsize = 20 # minimum size of face threshold =...
import tensorflow as tf from .. src.align import detect_face from .. src import facenet from .. simple import download_model import sys import os from os.path import expanduser import copy import cv2 import numpy as np from scipy import spatial minsize = 20 # minimum size of face threshold = [0.6, 0.7, 0.7] # three ...
en
0.801858
# minimum size of face # three steps's threshold # scale factor # check is model exists # Get input and output tensors # Run forward pass to calculate embeddings
2.29055
2
athena/athena/errors.py
aculich/openmappr
19
10406
<gh_stars>10-100 class AthenaError(Exception): """base class for all athena exceptions""" pass class AthenaMongoError(AthenaError): """Class for all mongo related errors""" pass
class AthenaError(Exception): """base class for all athena exceptions""" pass class AthenaMongoError(AthenaError): """Class for all mongo related errors""" pass
en
0.713593
base class for all athena exceptions Class for all mongo related errors
1.830688
2
tf2stats/__init__.py
TheAntecedent/Quintessence
1
10407
<filename>tf2stats/__init__.py from .aggregated_stats import * from .game_stats import * from .stat_definitions import *
<filename>tf2stats/__init__.py from .aggregated_stats import * from .game_stats import * from .stat_definitions import *
none
1
1.145168
1
tests/test_messages/test_inbound/test_manage_all_link_record.py
michaeldavie/pyinsteon
15
10408
"""Test Manage All-Link Record.""" import unittest from binascii import unhexlify from pyinsteon.address import Address from pyinsteon.constants import AckNak, ManageAllLinkRecordAction, MessageId from pyinsteon.protocol.messages.all_link_record_flags import \ AllLinkRecordFlags from tests import set_log_levels fr...
"""Test Manage All-Link Record.""" import unittest from binascii import unhexlify from pyinsteon.address import Address from pyinsteon.constants import AckNak, ManageAllLinkRecordAction, MessageId from pyinsteon.protocol.messages.all_link_record_flags import \ AllLinkRecordFlags from tests import set_log_levels fr...
en
0.54433
Test Manage All-Link Record. # pylint: disable=no-member Test Manage All-Link Record. Set up test. Test ID. Test ACK/NAK. Test bytes.
2.439274
2
Clock/Clock_Fig3F.py
chAwater/OpenFig
0
10409
<reponame>chAwater/OpenFig #!/usr/bin/env python # coding: utf-8 # # Figure Info. # # | Title | Journal | Authors | Article Date | Code Date | Figure | Links | # |:------|:-------:|:-------:|:------------:|:---------:|:------:|:-----:| # |A microfluidic approach for experimentally modelling <br> the intercellular cou...
#!/usr/bin/env python # coding: utf-8 # # Figure Info. # # | Title | Journal | Authors | Article Date | Code Date | Figure | Links | # |:------|:-------:|:-------:|:------------:|:---------:|:------:|:-----:| # |A microfluidic approach for experimentally modelling <br> the intercellular coupling system of a mammalian...
en
0.43014
#!/usr/bin/env python # coding: utf-8 # # Figure Info. # # | Title | Journal | Authors | Article Date | Code Date | Figure | Links | # |:------|:-------:|:-------:|:------------:|:---------:|:------:|:-----:| # |A microfluidic approach for experimentally modelling <br> the intercellular coupling system of a mammalian <...
2.522221
3
rameniaapp/views/report.py
awlane/ramenia
0
10410
from django.shortcuts import render, HttpResponse, HttpResponseRedirect from django.template import loader from django.conf import settings from django.contrib.auth.models import User from rameniaapp.models import ReviewReport, ProfileReport, NoodleReport, Report, Review, Profile, Noodle from django.views.generic impor...
from django.shortcuts import render, HttpResponse, HttpResponseRedirect from django.template import loader from django.conf import settings from django.contrib.auth.models import User from rameniaapp.models import ReviewReport, ProfileReport, NoodleReport, Report, Review, Profile, Noodle from django.views.generic impor...
en
0.885907
Class based view for creating reports Ensures hidden form values are filled Adds url_path value and relevant object id to template Class based view for reporting noodles #This is used to allow the form to create the correct object Ensures hidden form values are filled Passes item name to template Class based view for r...
1.974638
2
pyparser.py
ddurvaux/PyUnpacker
0
10411
#!/usr/bin/python # # This tool is an attempt to automate some taks related # to malware unpacking. # # Most (if not all) of the tricks used in this tool # directly comes from an excellent course given # by <NAME> (@nicolasbrulez) # # Tool developped by David DURVAUX for Autopsit # (commercial brand of N-Labs sprl) #...
#!/usr/bin/python # # This tool is an attempt to automate some taks related # to malware unpacking. # # Most (if not all) of the tricks used in this tool # directly comes from an excellent course given # by <NAME> (@nicolasbrulez) # # Tool developped by David DURVAUX for Autopsit # (commercial brand of N-Labs sprl) #...
en
0.58471
#!/usr/bin/python # # This tool is an attempt to automate some taks related # to malware unpacking. # # Most (if not all) of the tricks used in this tool # directly comes from an excellent course given # by <NAME> (@nicolasbrulez) # # Tool developped by David DURVAUX for Autopsit # (commercial brand of N-Labs sprl) # #...
1.971655
2
mjml/elements/head/mj_style.py
ESA-CCI-ODP/mjml-stub
23
10412
from ._head_base import HeadComponent __all__ = ['MjStyle'] class MjStyle(HeadComponent): @classmethod def default_attrs(cls): return { 'inline' : '', } def handler(self): add = self.context['add'] inline_attr = 'inlineStyle' if (self.get_attr('inl...
from ._head_base import HeadComponent __all__ = ['MjStyle'] class MjStyle(HeadComponent): @classmethod def default_attrs(cls): return { 'inline' : '', } def handler(self): add = self.context['add'] inline_attr = 'inlineStyle' if (self.get_attr('inl...
none
1
2.414489
2
model_zoo/official/nlp/bert/src/sample_process.py
i4oolish/mindspore
2
10413
<filename>model_zoo/official/nlp/bert/src/sample_process.py # Copyright 2020 Huawei Technologies Co., Ltd # # 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/LI...
<filename>model_zoo/official/nlp/bert/src/sample_process.py # Copyright 2020 Huawei Technologies Co., Ltd # # 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/LI...
en
0.796274
# Copyright 2020 Huawei Technologies Co., Ltd # # 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.58232
3
lang_model/data_loader.py
alex44jzy/FancyALMLDLNLP
0
10414
<gh_stars>0 import torch from torch.nn import functional as F from torch.utils.data import Dataset from gensim.corpora.dictionary import Dictionary class LangDataset(Dataset): def __init__(self, src_sents, trg_sents, max_len=-1): self.src_sents = src_sents self.trg_sents = trg_sents # Cre...
import torch from torch.nn import functional as F from torch.utils.data import Dataset from gensim.corpora.dictionary import Dictionary class LangDataset(Dataset): def __init__(self, src_sents, trg_sents, max_len=-1): self.src_sents = src_sents self.trg_sents = trg_sents # Create the voca...
en
0.718332
# Create the vocabulary for both the source and target. # Patch the vocabularies and add the <pad> and <unk> symbols. # Keep track of how many data points. # If it's not set, find the longest text in the data. # To pad the sentence: # Pad left = 0; Pad right = max_len - len of sent. :param tokens: Tokens that should be...
2.814436
3
models_nonconvex_simple2/ndcc13persp.py
grossmann-group/pyomo-MINLP-benchmarking
0
10415
<reponame>grossmann-group/pyomo-MINLP-benchmarking # MINLP written by GAMS Convert at 08/20/20 01:30:45 # # Equation counts # Total E G L N X C B # 297 170 42 85 0 0 0 0 # # Variable counts # ...
# MINLP written by GAMS Convert at 08/20/20 01:30:45 # # Equation counts # Total E G L N X C B # 297 170 42 85 0 0 0 0 # # Variable counts # x b i s1s s2s sc ...
en
0.748015
# MINLP written by GAMS Convert at 08/20/20 01:30:45 # # Equation counts # Total E G L N X C B # 297 170 42 85 0 0 0 0 # # Variable counts # x b i s1s s2s sc ...
1.315837
1
tests/pytests/scenarios/multimaster/conftest.py
lllamnyp/salt
0
10416
<gh_stars>0 import logging import os import shutil import subprocess import pytest import salt.utils.platform log = logging.getLogger(__name__) @pytest.fixture(scope="package", autouse=True) def skip_on_tcp_transport(request): if request.config.getoption("--transport") == "tcp": pytest.skip("Multimaster...
import logging import os import shutil import subprocess import pytest import salt.utils.platform log = logging.getLogger(__name__) @pytest.fixture(scope="package", autouse=True) def skip_on_tcp_transport(request): if request.config.getoption("--transport") == "tcp": pytest.skip("Multimaster under the T...
en
0.891435
#59053") # Use the same ports for both masters, they are binding to different interfaces # The secondary salt master depends on the primarily salt master fixture # because we need to clone the keys
1.835832
2
supermario/supermario 1117/start_state.py
Kimmiryeong/2DGP_GameProject
0
10417
import game_framework from pico2d import * import title_state name = "StartState" image = None logo_time = 0.0 def enter(): global image image = load_image('kpu_credit.png') def exit(): global image del(image) def update(): global logo_time if (logo_time > 1.0): logo_time = 0.8 ...
import game_framework from pico2d import * import title_state name = "StartState" image = None logo_time = 0.0 def enter(): global image image = load_image('kpu_credit.png') def exit(): global image del(image) def update(): global logo_time if (logo_time > 1.0): logo_time = 0.8 ...
none
1
2.843141
3
egs/librispeech/ASR/transducer/test_rnn.py
rosrad/icefall
0
10418
<reponame>rosrad/icefall<gh_stars>0 #!/usr/bin/env python3 # Copyright 2021 Xiaomi Corp. (authors: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lic...
#!/usr/bin/env python3 # Copyright 2021 Xiaomi Corp. (authors: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple 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...
en
0.843535
#!/usr/bin/env python3 # Copyright 2021 Xiaomi Corp. (authors: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple 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...
2.148093
2
settings.py
SalinderSidhu/CHIP8
4
10419
<filename>settings.py import configparser class Settings: '''The Settings class is a wrapper for configparser and it's functions. This class simplifies the tasks of loading, storing and manipulating settings data.''' def __init__(self, filename): '''Create a new Settings object with a specifi...
<filename>settings.py import configparser class Settings: '''The Settings class is a wrapper for configparser and it's functions. This class simplifies the tasks of loading, storing and manipulating settings data.''' def __init__(self, filename): '''Create a new Settings object with a specifi...
en
0.679763
The Settings class is a wrapper for configparser and it's functions. This class simplifies the tasks of loading, storing and manipulating settings data. Create a new Settings object with a specific file name. # Exceptions # Settings variables # Load settings from existing file (if one exists) Return True if the...
3.773241
4
demisto_sdk/commands/common/hook_validations/release_notes.py
yalonso7/demisto-sdk
0
10420
<filename>demisto_sdk/commands/common/hook_validations/release_notes.py from __future__ import print_function import itertools from demisto_sdk.commands.common.constants import VALIDATED_PACK_ITEM_TYPES from demisto_sdk.commands.common.errors import Errors from demisto_sdk.commands.common.hook_validations.base_valida...
<filename>demisto_sdk/commands/common/hook_validations/release_notes.py from __future__ import print_function import itertools from demisto_sdk.commands.common.constants import VALIDATED_PACK_ITEM_TYPES from demisto_sdk.commands.common.errors import Errors from demisto_sdk.commands.common.hook_validations.base_valida...
en
0.803394
Release notes validator is designed to ensure the existence and correctness of the release notes in content repo. Attributes: file_path (str): the path to the file we are examining at the moment. release_notes_path (str): the path to the changelog file of the examined file. latest_release_n...
2.0718
2
PyOpenGL/PyGame/ex06/src/mathematics.py
hoppfull/Legacy-Python
0
10421
import numpy as np class ProjectionMatrix(): """This matrix provides projection distortion. Projection distortion is when things that are far away appear smaller and things that are close appear bigger. This works flawlessly so far. Takes in screen-size and provides near- and far clipping. fov is f...
import numpy as np class ProjectionMatrix(): """This matrix provides projection distortion. Projection distortion is when things that are far away appear smaller and things that are close appear bigger. This works flawlessly so far. Takes in screen-size and provides near- and far clipping. fov is f...
en
0.892765
This matrix provides projection distortion. Projection distortion is when things that are far away appear smaller and things that are close appear bigger. This works flawlessly so far. Takes in screen-size and provides near- and far clipping. fov is field-of-view and smaller values will make view zo...
3.3909
3
test_utils/mocks.py
radomd92/botjagwar
7
10422
from xml.dom import minidom import pywikibot from api.decorator import time_this SiteMock = pywikibot.Site class PageMock(pywikibot.Page): def __init__(self, *args, **kwargs): super(PageMock, self).__init__(*args, **kwargs) self.filename = "test_data/test_pages_%s.xml" % self.site.lang ...
from xml.dom import minidom import pywikibot from api.decorator import time_this SiteMock = pywikibot.Site class PageMock(pywikibot.Page): def __init__(self, *args, **kwargs): super(PageMock, self).__init__(*args, **kwargs) self.filename = "test_data/test_pages_%s.xml" % self.site.lang ...
none
1
2.480304
2
dl_tensorflow/deepdream.py
jarvisqi/deep_learning
32
10423
import os from functools import partial from io import BytesIO import numpy as np import PIL.Image import scipy.misc import tensorflow as tf graph = tf.Graph() sess = tf.InteractiveSession(graph=graph) model_fn = "./models/tensorflow_inception_graph.pb" with tf.gfile.FastGFile(model_fn, 'rb') as f: graph_def = tf...
import os from functools import partial from io import BytesIO import numpy as np import PIL.Image import scipy.misc import tensorflow as tf graph = tf.Graph() sess = tf.InteractiveSession(graph=graph) model_fn = "./models/tensorflow_inception_graph.pb" with tf.gfile.FastGFile(model_fn, 'rb') as f: graph_def = tf...
zh
0.912128
# 定义t_input为我们输入的图像 # 输入图像需要经过处理才能送入网络中 # expand_dims是加一维,从[height, width, channel]变成[1, height, width, channel] # t_input - imagenet_mean是减去一个均值 # 找到所有卷积层 # 输出卷积层层数 # 特别地,输出mixed4d_3x3_bottleneck_pre_relu的形状 # 先在行上做整体移动,再在列上做整体移动 # 将拉普拉斯金字塔还原到原始图像 # 对img做标准化。 # 拉普拉斯金字塔标准化 # 每一层都做一次normalize_std # 这个函数将图像分为低频和高频成分 # 做过...
2.454681
2
admin.py
BlueBlock/usage-reporter
4
10424
import calendar import datetime import logging import os import webapp2 import dbmodel TESTING = os.environ.get('SERVER_SOFTWARE', '').startswith('Development') class ResetHandler(webapp2.RequestHandler): def get(self): timestamp = calendar.timegm(datetime.datetime.utcnow().timetuple()) self.re...
import calendar import datetime import logging import os import webapp2 import dbmodel TESTING = os.environ.get('SERVER_SOFTWARE', '').startswith('Development') class ResetHandler(webapp2.RequestHandler): def get(self): timestamp = calendar.timegm(datetime.datetime.utcnow().timetuple()) self.re...
none
1
2.524477
3
napari/utils/colormaps/categorical_colormap_utils.py
Zac-HD/napari
1
10425
from dataclasses import dataclass from itertools import cycle from typing import Dict, Union import numpy as np from ...layers.utils.color_transformations import ( transform_color, transform_color_cycle, ) @dataclass(eq=False) class ColorCycle: """A dataclass to hold a color cycle for the fallback_color...
from dataclasses import dataclass from itertools import cycle from typing import Dict, Union import numpy as np from ...layers.utils.color_transformations import ( transform_color, transform_color_cycle, ) @dataclass(eq=False) class ColorCycle: """A dataclass to hold a color cycle for the fallback_color...
en
0.524431
A dataclass to hold a color cycle for the fallback_colors in the CategoricalColormap Attributes ---------- values : np.ndarray The (Nx4) color array of all colors contained in the color cycle. cycle : cycle The cycle object that gives fallback colors. # turn a generic dict into obje...
2.817931
3
src/ipywidgets_toggle_buttons/abc_toggle_buttons_with_hide.py
stas-prokopiev/ipywidgets_toggle_buttons
0
10426
"""Abstract class for all toggle buttons""" # Standard library imports import logging from collections import OrderedDict # Third party imports import ipywidgets # Local imports from .abc_toggle_buttons import BaseToggleButtons from .layouts import DICT_LAYOUT_HBOX_ANY LOGGER = logging.getLogger(__name__) class Ba...
"""Abstract class for all toggle buttons""" # Standard library imports import logging from collections import OrderedDict # Third party imports import ipywidgets # Local imports from .abc_toggle_buttons import BaseToggleButtons from .layouts import DICT_LAYOUT_HBOX_ANY LOGGER = logging.getLogger(__name__) class Ba...
en
0.618118
Abstract class for all toggle buttons # Standard library imports # Third party imports # Local imports Abstract class for all toggle buttons Values are stored in self.widget_parent when displayed is self.widget Which is updated in the moment when display() is launched Initialize object # hidden attributes to s...
2.608826
3
Players/DWPMPlayer.py
jokvedaras/game-framework
0
10427
__author__ = '<NAME> and <NAME>' import Player import Message # input #0 for rock #1 for paper #2 for scissors # past move is array of numbers # our move followed by their move #Our strategy is to look at all past moves #In a large number of games, you would expect # each move to be seen an even amount of times #So...
__author__ = '<NAME> and <NAME>' import Player import Message # input #0 for rock #1 for paper #2 for scissors # past move is array of numbers # our move followed by their move #Our strategy is to look at all past moves #In a large number of games, you would expect # each move to be seen an even amount of times #So...
en
0.960794
# input #0 for rock #1 for paper #2 for scissors # past move is array of numbers # our move followed by their move #Our strategy is to look at all past moves #In a large number of games, you would expect # each move to be seen an even amount of times #So our strategy is to take the least seen move # and expect it ...
3.570548
4
example/example.py
mowshon/age-and-gender
81
10428
<filename>example/example.py from age_and_gender import * from PIL import Image, ImageDraw, ImageFont data = AgeAndGender() data.load_shape_predictor('models/shape_predictor_5_face_landmarks.dat') data.load_dnn_gender_classifier('models/dnn_gender_classifier_v1.dat') data.load_dnn_age_predictor('models/dnn_age_predict...
<filename>example/example.py from age_and_gender import * from PIL import Image, ImageDraw, ImageFont data = AgeAndGender() data.load_shape_predictor('models/shape_predictor_5_face_landmarks.dat') data.load_dnn_gender_classifier('models/dnn_gender_classifier_v1.dat') data.load_dnn_age_predictor('models/dnn_age_predict...
none
1
2.992659
3
code/generate_games.py
jppg/pygame-tictactoe
0
10429
from tictactoe import TicTacToe import random import csv import os gameNr = 1 gameLimit = 10000 lst_moves_1 = [] lst_moves_2 = [] while gameNr <= gameLimit: print("+++++++++++") print("Game#", gameNr) game = TicTacToe() tmp_moves_1 = [] tmp_moves_2 = [] while game.get_winner() == 0 and game....
from tictactoe import TicTacToe import random import csv import os gameNr = 1 gameLimit = 10000 lst_moves_1 = [] lst_moves_2 = [] while gameNr <= gameLimit: print("+++++++++++") print("Game#", gameNr) game = TicTacToe() tmp_moves_1 = [] tmp_moves_2 = [] while game.get_winner() == 0 and game....
en
0.119504
#", gameNr) #lst_moves_1.append(tmp_moves_1[len(tmp_moves_1) - 1]) #lst_moves_2.append(tmp_moves_2[len(tmp_moves_2) - 1]) #print("List X: ", lst_moves_1) #print("List O: ", lst_moves_2)
3.411806
3
applications/CoSimulationApplication/custom_data_structure/pyKratos/IntervalUtility.py
lcirrott/Kratos
2
10430
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7 # TODO this should be implemented, see "kratos/utilities/interval_utility.h" class IntervalUtility(object): def __init__(self, settings): pass def IsInInterval(self, curr...
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7 # TODO this should be implemented, see "kratos/utilities/interval_utility.h" class IntervalUtility(object): def __init__(self, settings): pass def IsInInterval(self, curr...
en
0.762129
# makes these scripts backward compatible with python 2.6 and 2.7 # TODO this should be implemented, see "kratos/utilities/interval_utility.h"
2.067049
2
stixcore/tmtc/tests/test_packets.py
nicHoch/STIXCore
1
10431
import bitstring import pytest from stixcore.data.test import test_data from stixcore.idb.manager import IDBManager from stixcore.tmtc.packets import ( SOURCE_PACKET_HEADER_STRUCTURE, TC_DATA_HEADER_STRUCTURE, TM_DATA_HEADER_STRUCTURE, SourcePacketHeader, TCPacket, TMDataHeader, TMPacket, ...
import bitstring import pytest from stixcore.data.test import test_data from stixcore.idb.manager import IDBManager from stixcore.tmtc.packets import ( SOURCE_PACKET_HEADER_STRUCTURE, TC_DATA_HEADER_STRUCTURE, TM_DATA_HEADER_STRUCTURE, SourcePacketHeader, TCPacket, TMDataHeader, TMPacket, ...
none
1
2.110349
2
python/thunder/rdds/fileio/seriesloader.py
broxtronix/thunder
0
10432
<reponame>broxtronix/thunder<gh_stars>0 """Provides SeriesLoader object and helpers, used to read Series data from disk or other filesystems. """ from collections import namedtuple import json from numpy import array, arange, frombuffer, load, ndarray, unravel_index, vstack from numpy import dtype as dtypeFunc from sci...
"""Provides SeriesLoader object and helpers, used to read Series data from disk or other filesystems. """ from collections import namedtuple import json from numpy import array, arange, frombuffer, load, ndarray, unravel_index, vstack from numpy import dtype as dtypeFunc from scipy.io import loadmat from cStringIO impo...
en
0.728846
Provides SeriesLoader object and helpers, used to read Series data from disk or other filesystems. Loader object used to instantiate Series data stored in a variety of formats. Initialize a new SeriesLoader object. Parameters ---------- sparkcontext: SparkContext The pyspark SparkCo...
2.508989
3
mxnet/local_forward.py
rai-project/onnx_examples
0
10433
# run local models given a path, default to './mxnet_models/' import os import argparse import time import mxnet as mx import numpy as np file_path = os.path.realpath(__file__) dir_name = os.path.dirname(file_path) os.environ["MXNET_CUDNN_AUTOTUNE_DEFAULT"] = "0" class cuda_profiler_start(): import numba.cuda ...
# run local models given a path, default to './mxnet_models/' import os import argparse import time import mxnet as mx import numpy as np file_path = os.path.realpath(__file__) dir_name = os.path.dirname(file_path) os.environ["MXNET_CUDNN_AUTOTUNE_DEFAULT"] = "0" class cuda_profiler_start(): import numba.cuda ...
en
0.396913
# run local models given a path, default to './mxnet_models/' # stop timer
2.276259
2
tests/test_get_angles.py
Mopolino8/lammps-data-file
13
10434
<reponame>Mopolino8/lammps-data-file<gh_stars>10-100 from lammps_data.angles import get_angles def test_separate_diatomic_molecules_should_have_no_angles(): bonds = [(0, 1), (2, 3)] assert get_angles(bonds) == [] def test_molecule_with_two_bonds_should_have_one_angle(): bonds = [(0, 1), (1, 2)] asse...
from lammps_data.angles import get_angles def test_separate_diatomic_molecules_should_have_no_angles(): bonds = [(0, 1), (2, 3)] assert get_angles(bonds) == [] def test_molecule_with_two_bonds_should_have_one_angle(): bonds = [(0, 1), (1, 2)] assert get_angles(bonds) == [(0, 1, 2)] def test_differ...
none
1
2.678447
3
api/scheduler/migrations/0001_initial.py
jfaach/stock-app
0
10435
# Generated by Django 3.1.1 on 2020-12-16 03:07 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Scheduler', fields=[ ('id', models.AutoFiel...
# Generated by Django 3.1.1 on 2020-12-16 03:07 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Scheduler', fields=[ ('id', models.AutoFiel...
en
0.818878
# Generated by Django 3.1.1 on 2020-12-16 03:07
1.730323
2
9-Wine-Scaling.py
Pawel762/Class-7_homework
0
10436
from sklearn.preprocessing import StandardScaler from sklearn.datasets import load_wine from sklearn.model_selection import train_test_split wine = load_wine() columns_names = wine.feature_names y = wine.target X = wine.data print('Pre scaling X') print(X) scaler = StandardScaler() scaler.fit(X) scaled_features = sc...
from sklearn.preprocessing import StandardScaler from sklearn.datasets import load_wine from sklearn.model_selection import train_test_split wine = load_wine() columns_names = wine.feature_names y = wine.target X = wine.data print('Pre scaling X') print(X) scaler = StandardScaler() scaler.fit(X) scaled_features = sc...
none
1
2.952666
3
tests/conftest.py
szkkteam/flask-starter
0
10437
<reponame>szkkteam/flask-starter<filename>tests/conftest.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Common Python library imports import os import pytest # Pip package imports from collections import namedtuple from flask import template_rendered from flask_security.signals import ( reset_password_instruc...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Common Python library imports import os import pytest # Pip package imports from collections import namedtuple from flask import template_rendered from flask_security.signals import ( reset_password_instructions_sent, user_confirmed, user_registered, ) # In...
en
0.463209
#!/usr/bin/env python # -*- coding: utf-8 -*- # Common Python library imports # Pip package imports # Internal package imports #ctx = app.app_context()
1.88447
2
setup.py
YiuRULE/nats.py
0
10438
<gh_stars>0 from setuptools import setup from nats.aio.client import __version__ EXTRAS = { 'nkeys': ['nkeys'], } setup( name='nats-py', version=__version__, description='NATS client for Python', long_description='Python client for NATS, a lightweight, high-performance cloud native messaging syst...
from setuptools import setup from nats.aio.client import __version__ EXTRAS = { 'nkeys': ['nkeys'], } setup( name='nats-py', version=__version__, description='NATS client for Python', long_description='Python client for NATS, a lightweight, high-performance cloud native messaging system', cla...
none
1
1.238945
1
example_python_files/MagicDAQ,MABoard,FullDemo.py
MagicDAQ/magicdaq_docs
1
10439
############################################################## #*** MagicDAQ USB DAQ and M&A Board General Demo Script *** ############################################################## #*** Websites *** # MagicDAQ Website: # https://www.magicdaq.com/ # API Docs Website: # https://magicdaq.github.io/magicdaq_docs/ #*...
############################################################## #*** MagicDAQ USB DAQ and M&A Board General Demo Script *** ############################################################## #*** Websites *** # MagicDAQ Website: # https://www.magicdaq.com/ # API Docs Website: # https://magicdaq.github.io/magicdaq_docs/ #*...
de
0.403097
############################################################## #*** MagicDAQ USB DAQ and M&A Board General Demo Script *** ############################################################## #*** Websites *** # MagicDAQ Website: # https://www.magicdaq.com/ # API Docs Website: # https://magicdaq.github.io/magicdaq_docs/ #***...
2.34102
2
src/onenutil/schemas/__init__.py
LemurPwned/onenote-utils
0
10440
from .results import (ArticleSearchResult, EmbeddingsResult, SearchResult, TagResult, ZoteroExtractionResult) __all__ = [ "TagResult", "EmbeddingsResult", "ZoteroExtractionResult", "SearchResult", "ArticleSearchResult" ]
from .results import (ArticleSearchResult, EmbeddingsResult, SearchResult, TagResult, ZoteroExtractionResult) __all__ = [ "TagResult", "EmbeddingsResult", "ZoteroExtractionResult", "SearchResult", "ArticleSearchResult" ]
none
1
1.114453
1
src/account/api/serializers.py
amirpsd/drf_blog_api
33
10441
<filename>src/account/api/serializers.py from django.contrib.auth import get_user_model from rest_framework import serializers class UsersListSerializer(serializers.ModelSerializer): class Meta: model = get_user_model() fields = [ "id", "phone", "first_name", "last_name", ...
<filename>src/account/api/serializers.py from django.contrib.auth import get_user_model from rest_framework import serializers class UsersListSerializer(serializers.ModelSerializer): class Meta: model = get_user_model() fields = [ "id", "phone", "first_name", "last_name", ...
en
0.776362
Base serializer two-step-password.
2.349587
2
generate_figure9.py
IBM/Simultaneous-diagonalization
0
10442
# Copyright 2022 IBM Inc. All rights reserved # SPDX-License-Identifier: Apache2.0 # 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 ...
# Copyright 2022 IBM Inc. All rights reserved # SPDX-License-Identifier: Apache2.0 # 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 ...
en
0.8377
# Copyright 2022 IBM Inc. All rights reserved # SPDX-License-Identifier: Apache2.0 # 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 r...
2.049438
2
undeployed/legacy/Landsat/L7GapFiller_ArcInterface.py
NASA-DEVELOP/dnppy
65
10443
<filename>undeployed/legacy/Landsat/L7GapFiller_ArcInterface.py #------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: qgeddes # # Created: 25/04/2013 # Copyright: (c) qgeddes 2013 # Licence: <your licence> #-------------------------...
<filename>undeployed/legacy/Landsat/L7GapFiller_ArcInterface.py #------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: qgeddes # # Created: 25/04/2013 # Copyright: (c) qgeddes 2013 # Licence: <your licence> #-------------------------...
en
0.197105
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: qgeddes # # Created: 25/04/2013 # Copyright: (c) qgeddes 2013 # Licence: <your licence> #-------------------------------------------------------------------------------
1.602437
2
tests/sentry/api/serializers/test_saved_search.py
practo/sentry
4
10444
<filename>tests/sentry/api/serializers/test_saved_search.py # -*- coding: utf-8 -*- from __future__ import absolute_import import six from sentry.api.serializers import serialize from sentry.models import SavedSearch from sentry.models.savedsearch import DEFAULT_SAVED_SEARCHES from sentry.testutils import TestCase ...
<filename>tests/sentry/api/serializers/test_saved_search.py # -*- coding: utf-8 -*- from __future__ import absolute_import import six from sentry.api.serializers import serialize from sentry.models import SavedSearch from sentry.models.savedsearch import DEFAULT_SAVED_SEARCHES from sentry.testutils import TestCase ...
en
0.769321
# -*- coding: utf-8 -*-
2.28036
2
xastropy/files/general.py
bpholden/xastropy
3
10445
""" #;+ #; NAME: #; general #; Version 1.0 #; #; PURPOSE: #; Module for monkeying with files and filenames #; 172Sep-2014 by JXP #;- #;------------------------------------------------------------------------------ """ # Import libraries import numpy as np from astropy.io import fits from astropy.io import as...
""" #;+ #; NAME: #; general #; Version 1.0 #; #; PURPOSE: #; Module for monkeying with files and filenames #; 172Sep-2014 by JXP #;- #;------------------------------------------------------------------------------ """ # Import libraries import numpy as np from astropy.io import fits from astropy.io import as...
en
0.43099
#;+ #; NAME: #; general #; Version 1.0 #; #; PURPOSE: #; Module for monkeying with files and filenames #; 172Sep-2014 by JXP #;- #;------------------------------------------------------------------------------ # Import libraries #### ############################### # Deal with .gz extensions, usually on FITS ...
2.575205
3
setup.py
muatik/genderizer
54
10446
#!/usr/bin/env python try: from setuptools.core import setup except ImportError: from distutils.core import setup setup(name='genderizer', version='0.1.2.3', license='MIT', description='Genderizer tries to infer gender information looking at first name and/or making text analysis', lo...
#!/usr/bin/env python try: from setuptools.core import setup except ImportError: from distutils.core import setup setup(name='genderizer', version='0.1.2.3', license='MIT', description='Genderizer tries to infer gender information looking at first name and/or making text analysis', lo...
ru
0.26433
#!/usr/bin/env python
1.385871
1
ingestion/tests/unit/great_expectations/test_ometa_validation_action.py
ulixius9/OpenMetadata
0
10447
# Copyright 2022 Collate # 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, software...
# Copyright 2022 Collate # 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, software...
en
0.785626
# Copyright 2022 Collate # 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, software...
1.950374
2
tests/integration/Containers.py
adnrs96/runtime
0
10448
# -*- coding: utf-8 -*- from storyruntime.Containers import Containers from storyruntime.constants.ServiceConstants import ServiceConstants import storyscript def test_containers_format_command(story): """ Ensures a simple resolve can be performed """ story_text = 'alpine echo msg:"foo"\n' story....
# -*- coding: utf-8 -*- from storyruntime.Containers import Containers from storyruntime.constants.ServiceConstants import ServiceConstants import storyscript def test_containers_format_command(story): """ Ensures a simple resolve can be performed """ story_text = 'alpine echo msg:"foo"\n' story....
en
0.875671
# -*- coding: utf-8 -*- Ensures a simple resolve can be performed
2.585179
3
project_name/core/admin.py
cosmunsoftwares/django-boilerplate
3
10449
from django.contrib import admin from django.shortcuts import redirect from django.utils.safestring import mark_safe from django.contrib.admin.widgets import AdminFileWidget class AdminImageWidget(AdminFileWidget): def render(self, name, value, attrs=None, renderer=None): output = [] if value and ...
from django.contrib import admin from django.shortcuts import redirect from django.utils.safestring import mark_safe from django.contrib.admin.widgets import AdminFileWidget class AdminImageWidget(AdminFileWidget): def render(self, name, value, attrs=None, renderer=None): output = [] if value and ...
none
1
2.022962
2
src/5vents.py
subhash686/aoc-2021
0
10450
<reponame>subhash686/aoc-2021 import os plane = [[0 for i in range(1000)] for j in range(1000)] count = [0] def overlapping_vents(): path = os.getcwd() file_path = os.path.join(path, 'vents.txt') file1 = open(file_path, 'r') Lines = file1.readlines() for line in Lines: input = line.strip...
import os plane = [[0 for i in range(1000)] for j in range(1000)] count = [0] def overlapping_vents(): path = os.getcwd() file_path = os.path.join(path, 'vents.txt') file1 = open(file_path, 'r') Lines = file1.readlines() for line in Lines: input = line.strip() points = input.spli...
none
1
3.292151
3
problems/test_0073_m_plus_n_space.py
chrisxue815/leetcode_python
1
10451
import unittest class Solution: def setZeroes(self, matrix): """ :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. """ rows = [0] * len(matrix) cols = [0] * len(matrix[0]) for i, row in enumerate(matrix): ...
import unittest class Solution: def setZeroes(self, matrix): """ :type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead. """ rows = [0] * len(matrix) cols = [0] * len(matrix[0]) for i, row in enumerate(matrix): ...
en
0.397521
:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.
3.480713
3
xlsxwriter/test/worksheet/test_write_print_options.py
Aeon1/XlsxWriter
2
10452
<reponame>Aeon1/XlsxWriter<filename>xlsxwriter/test/worksheet/test_write_print_options.py ############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2019, <NAME>, <EMAIL> # import unittest from ...compatibility import StringIO from ...worksheet imp...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2019, <NAME>, <EMAIL> # import unittest from ...compatibility import StringIO from ...worksheet import Worksheet class TestWritePrintOptions(unittest.TestCase): """ Test the Works...
en
0.480874
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2019, <NAME>, <EMAIL> # Test the Worksheet _write_print_options() method. Test the _write_print_options() method without options Test the _write_print_options() method with horizontal center...
2.834799
3
neo4j_helper.py
smartaec/OpenBridgeGraph
0
10453
<reponame>smartaec/OpenBridgeGraph<filename>neo4j_helper.py from neo4j.v1 import GraphDatabase #neo4j==1.7.0 uri="bolt://localhost:7687" driver=GraphDatabase.driver(uri, auth=("neo4j", "testneo4j")) def execute_queries(scripts,message=None): with driver.session() as session: tx=session.begin_transaction()...
from neo4j.v1 import GraphDatabase #neo4j==1.7.0 uri="bolt://localhost:7687" driver=GraphDatabase.driver(uri, auth=("neo4j", "testneo4j")) def execute_queries(scripts,message=None): with driver.session() as session: tx=session.begin_transaction() res=tx.run(';'.join(scripts)) tx.commit() ...
en
0.251728
#neo4j==1.7.0 #execute_read(print_query,'Alice')
2.638175
3
tests/unit/test_juju.py
KellenRenshaw/hotsos
0
10454
<filename>tests/unit/test_juju.py import os import tempfile import mock from . import utils from hotsos.core.config import setup_config from hotsos.core.ycheck.scenarios import YScenarioChecker from hotsos.core.issues.utils import KnownBugsStore, IssuesStore from hotsos.plugin_extensions.juju import summary JOURNAL...
<filename>tests/unit/test_juju.py import os import tempfile import mock from . import utils from hotsos.core.config import setup_config from hotsos.core.ycheck.scenarios import YScenarioChecker from hotsos.core.issues.utils import KnownBugsStore, IssuesStore from hotsos.plugin_extensions.juju import summary JOURNAL...
en
0.877132
Dec 21 14:07:53 juju-1 mongod.37017[17873]: [replication-18] CollectionCloner ns:juju.txns.log finished cloning with status: QueryPlanKilled: PlanExecutor killed: CappedPositionLost: CollectionScan died due to position in capped collection being deleted. Last seen record id: RecordId(204021366) Dec 21 14:07:53 juju-1 m...
1.663707
2
tools/SPGAN/main.py
by-liu/OpenUnReID
0
10455
import argparse import collections import shutil import sys import time from datetime import timedelta from pathlib import Path import torch from torch.nn.parallel import DataParallel, DistributedDataParallel try: # PyTorch >= 1.6 supports mixed precision training from torch.cuda.amp import autocast amp_su...
import argparse import collections import shutil import sys import time from datetime import timedelta from pathlib import Path import torch from torch.nn.parallel import DataParallel, DistributedDataParallel try: # PyTorch >= 1.6 supports mixed precision training from torch.cuda.amp import autocast amp_su...
en
0.529551
# PyTorch >= 1.6 supports mixed precision training # Forward # G_A(A) # G_B(B) # G_B(G_A(A)) # G_A(G_B(B)) # G_A and G_B # save memory # SiaNet for SPGAN # D_A and D_B # self.optimizer['D'].zero_grad() # self.backward_D() # self.optimizer['D'].step() # save translated images # positive pairs # negative pairs # positive...
1.963891
2
utility/data_download.py
LatvianPython/wind-experience
2
10456
import logging import requests import multiprocessing import pathlib from typing import List from typing import Optional from typing import Tuple from typing import Dict from joblib import delayed from joblib import Parallel from datetime import date from datetime import timedelta logger = logging.getLogger(__name__) ...
import logging import requests import multiprocessing import pathlib from typing import List from typing import Optional from typing import Tuple from typing import Dict from joblib import delayed from joblib import Parallel from datetime import date from datetime import timedelta logger = logging.getLogger(__name__) ...
none
1
2.518842
3
model/net_qspline_A.py
jercoco/QSQF
0
10457
<filename>model/net_qspline_A.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Oct 21 19:52:22 2020 #Plan A @author: 18096 """ '''Defines the neural network, loss function and metrics''' #from functools import reduce import torch import torch.nn as nn from torch.nn.functional import pad from torc...
<filename>model/net_qspline_A.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Oct 21 19:52:22 2020 #Plan A @author: 18096 """ '''Defines the neural network, loss function and metrics''' #from functools import reduce import torch import torch.nn as nn from torch.nn.functional import pad from torc...
en
0.737448
# -*- coding: utf-8 -*- Created on Wed Oct 21 19:52:22 2020 #Plan A @author: 18096 Defines the neural network, loss function and metrics #from functools import reduce We define a recurrent network that predicts the future values of a time-dependent variable based on past inputs and covariates. # initialize L...
2.378718
2
tests/repositories/helpers/methods/test_reinstall_if_needed.py
traibnn/integration
1
10458
<filename>tests/repositories/helpers/methods/test_reinstall_if_needed.py import pytest @pytest.mark.asyncio async def test_reinstall_if_needed(repository): repository.content.path.local = "/non/existing/dir" repository.data.installed = True await repository.async_reinstall_if_needed()
<filename>tests/repositories/helpers/methods/test_reinstall_if_needed.py import pytest @pytest.mark.asyncio async def test_reinstall_if_needed(repository): repository.content.path.local = "/non/existing/dir" repository.data.installed = True await repository.async_reinstall_if_needed()
none
1
1.814353
2
workflow_parser/datasource/log_engine.py
cyx1231st/workflow_parser
0
10459
<filename>workflow_parser/datasource/log_engine.py<gh_stars>0 # Copyright (c) 2017 <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 #...
<filename>workflow_parser/datasource/log_engine.py<gh_stars>0 # Copyright (c) 2017 <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 #...
en
0.719765
# Copyright (c) 2017 <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 writing, ...
1.957511
2
IPython/lib/tests/test_irunner_pylab_magic.py
dchichkov/ipython
0
10460
"""Test suite for pylab_import_all magic Modified from the irunner module but using regex. """ # Global to make tests extra verbose and help debugging VERBOSE = True # stdlib imports import StringIO import sys import unittest import re # IPython imports from IPython.lib import irunner from IPython.testing import dec...
"""Test suite for pylab_import_all magic Modified from the irunner module but using regex. """ # Global to make tests extra verbose and help debugging VERBOSE = True # stdlib imports import StringIO import sys import unittest import re # IPython imports from IPython.lib import irunner from IPython.testing import dec...
en
0.581641
Test suite for pylab_import_all magic Modified from the irunner module but using regex. # Global to make tests extra verbose and help debugging # stdlib imports # IPython imports Test if importing pylab fails with RuntimeError (true when having no display) # Testing code begins #self.out = sys.stdout Test that a given ...
2.559547
3
checkpoint.py
GooLee0123/MBRNN
1
10461
import logging import os import shutil import time import torch model_state = 'model_state.pt' trainer_state = 'trainer_state.pt' class Checkpoint(): def __init__(self, step, epoch, model, optim, path=None, opt=None): self.step = step self.epoch = epoch self.model = model self.o...
import logging import os import shutil import time import torch model_state = 'model_state.pt' trainer_state = 'trainer_state.pt' class Checkpoint(): def __init__(self, step, epoch, model, optim, path=None, opt=None): self.step = step self.epoch = epoch self.model = model self.o...
none
1
2.37965
2
test/eval_mines_color.py
alalagong/LEDNet
3
10462
import numpy as np import torch import os import cv2 import importlib from dataset import * from PIL import Image from argparse import ArgumentParser from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision.transforms import Compose, CenterCrop, Normalize, Resize from torchvision.tr...
import numpy as np import torch import os import cv2 import importlib from dataset import * from PIL import Image from argparse import ArgumentParser from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision.transforms import Compose, CenterCrop, Normalize, Resize from torchvision.tr...
en
0.436171
#* *******************测试单张图片**************************** # Normalize([.485, .456, .406], [.229, .224, .225]), # model.load_state_dict(torch.load(args.state)) # model.load_state_dict(torch.load(weightspath)) #not working if missing key # custom function to load model when not all dict elements # loader = DataLoader( # ...
2.357113
2
tests/test_resource_linkage.py
firesock/pydantic-jsonapi
0
10463
import pytest from pytest import raises from pydantic_jsonapi.resource_linkage import ResourceLinkage from pydantic import BaseModel, ValidationError class ThingWithLinkageData(BaseModel): data: ResourceLinkage class TestResourceLinks: @pytest.mark.parametrize( 'linkage, message', [ ...
import pytest from pytest import raises from pydantic_jsonapi.resource_linkage import ResourceLinkage from pydantic import BaseModel, ValidationError class ThingWithLinkageData(BaseModel): data: ResourceLinkage class TestResourceLinks: @pytest.mark.parametrize( 'linkage, message', [ ...
none
1
2.512387
3
src/tensorflow/keras_cnn.py
del680202/MachineLearning-memo
4
10464
import numpy as np from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD from keras.utils import np_utils import keras.callbacks import keras.backend.tensorflow_backend as KTF import tensorflow as tf batch_size = 1...
import numpy as np from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD from keras.utils import np_utils import keras.callbacks import keras.backend.tensorflow_backend as KTF import tensorflow as tf batch_size = 1...
en
0.760369
# load data # reshape # rescale # convert class vectors to binary class matrices (one hot vectors) # build model
2.822208
3
tests/blas/nodes/ger_test.py
xiacijie/dace
1
10465
<reponame>xiacijie/dace #!/usr/bin/env python3 # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. from dace.transformation.dataflow.streaming_memory import StreamingMemory from dace.transformation.interstate.sdfg_nesting import InlineSDFG from dace.transformation.interstate.fpga_transform_sdfg...
#!/usr/bin/env python3 # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. from dace.transformation.dataflow.streaming_memory import StreamingMemory from dace.transformation.interstate.sdfg_nesting import InlineSDFG from dace.transformation.interstate.fpga_transform_sdfg import FPGATransformSDF...
en
0.474033
#!/usr/bin/env python3 # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
2.053641
2
spp.py
ninfueng/torch-cifar
0
10466
<reponame>ninfueng/torch-cifar import math from typing import List, Union import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor @torch.jit.script def spatial_pyramid_pool( input: Tensor, bins: Union[int, List[int]], mode: str = "max" ) -> Tensor: """Spatial Pyramid Pooli...
import math from typing import List, Union import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor @torch.jit.script def spatial_pyramid_pool( input: Tensor, bins: Union[int, List[int]], mode: str = "max" ) -> Tensor: """Spatial Pyramid Pooling: https://arxiv.org/pdf/1406....
en
0.589503
Spatial Pyramid Pooling: https://arxiv.org/pdf/1406.4729.pdf Args: input (Tensor): an input tensor expected from the convolutional layer. bins (List[int]): a list of integer of preferred size of outputs. mode (str): how to reduce the spatial space. Returns: outputs (Tensor): a ...
3.068665
3
src/SparseSC/utils/AzureBatch/azure_batch_client.py
wofein/SparseSC
0
10467
""" usage requires these additional modules pip install azure-batch azure-storage-blob jsonschema pyyaml && pip install git+https://github.com/microsoft/SparseSC.git@ad4bf27edb28f517508f6934f21eb65d17fb6543 && scgrad start usage: from SparseSC import fit, aggregate_batch_results from SparseSC.utils.azure_batch_clie...
""" usage requires these additional modules pip install azure-batch azure-storage-blob jsonschema pyyaml && pip install git+https://github.com/microsoft/SparseSC.git@ad4bf27edb28f517508f6934f21eb65d17fb6543 && scgrad start usage: from SparseSC import fit, aggregate_batch_results from SparseSC.utils.azure_batch_clie...
en
0.671033
usage requires these additional modules pip install azure-batch azure-storage-blob jsonschema pyyaml && pip install git+https://github.com/microsoft/SparseSC.git@ad4bf27edb28f517508f6934f21eb65d17fb6543 && scgrad start usage: from SparseSC import fit, aggregate_batch_results from SparseSC.utils.azure_batch_client i...
2.170586
2
src/vilbert/datasets/__init__.py
NoOneUST/COMP5212
3
10468
<reponame>NoOneUST/COMP5212 from .visual_entailment_dataset import VisualEntailmentDataset
from .visual_entailment_dataset import VisualEntailmentDataset
none
1
1.014172
1
Dungeoneer/Treasure.py
jameslemon81/Dungeoneer
12
10469
<filename>Dungeoneer/Treasure.py # Basic Fantasy RPG Dungeoneer Suite # Copyright 2007-2012 <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 ...
<filename>Dungeoneer/Treasure.py # Basic Fantasy RPG Dungeoneer Suite # Copyright 2007-2012 <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 ...
en
0.59987
# Basic Fantasy RPG Dungeoneer Suite # Copyright 2007-2012 <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, sel...
1.550305
2
covid19/COVID19/code/controller/main.py
zhanqingheng/COVID-19
16
10470
from flask import Flask, current_app from flask import render_template from flask import jsonify from jieba.analyse import extract_tags import string from DB import chinaSQL from DB import worldSQL app = Flask(__name__, template_folder='../../web', static_folder='../../static') @app.route('/', methods=["get", "post"...
from flask import Flask, current_app from flask import render_template from flask import jsonify from jieba.analyse import extract_tags import string from DB import chinaSQL from DB import worldSQL app = Flask(__name__, template_folder='../../web', static_folder='../../static') @app.route('/', methods=["get", "post"...
none
1
2.447662
2
T2API/migrations/0008_product_weight.py
hackhb18-T2/api
0
10471
# Generated by Django 2.0.2 on 2018-02-17 10:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('T2API', '0007_apiuser_deviceuser'), ] operations = [ migrations.AddField( model_name='product', name='weight', ...
# Generated by Django 2.0.2 on 2018-02-17 10:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('T2API', '0007_apiuser_deviceuser'), ] operations = [ migrations.AddField( model_name='product', name='weight', ...
en
0.807271
# Generated by Django 2.0.2 on 2018-02-17 10:50
1.635558
2
contrib/cirrus/podbot.py
juhp/libpod
2
10472
#!/usr/bin/env python3 # Simple and dumb script to send a message to the #podman IRC channel on frenode # Based on example from: https://pythonspot.com/building-an-irc-bot/ import os import time import random import errno import socket import sys class IRC: response_timeout = 10 # seconds irc = socket.sock...
#!/usr/bin/env python3 # Simple and dumb script to send a message to the #podman IRC channel on frenode # Based on example from: https://pythonspot.com/building-an-irc-bot/ import os import time import random import errno import socket import sys class IRC: response_timeout = 10 # seconds irc = socket.sock...
en
0.89777
#!/usr/bin/env python3 # Simple and dumb script to send a message to the #podman IRC channel on frenode # Based on example from: https://pythonspot.com/building-an-irc-bot/ # seconds # can't handle this # Error # This is ugly as sin, but seems to be a working send/expect sequence #connects to the server # avoid join/qu...
2.575957
3
changes/api/build_coverage.py
vault-the/changes
443
10473
<reponame>vault-the/changes from changes.api.base import APIView from changes.lib.coverage import get_coverage_by_build_id, merged_coverage_data from changes.models.build import Build class BuildTestCoverageAPIView(APIView): def get(self, build_id): build = Build.query.get(build_id) if build is ...
from changes.api.base import APIView from changes.lib.coverage import get_coverage_by_build_id, merged_coverage_data from changes.models.build import Build class BuildTestCoverageAPIView(APIView): def get(self, build_id): build = Build.query.get(build_id) if build is None: return '',...
none
1
2.033235
2
topopt/mechanisms/problems.py
arnavbansal2764/topopt
53
10474
<reponame>arnavbansal2764/topopt<gh_stars>10-100 """Compliant mechanism synthesis problems using topology optimization.""" import numpy import scipy.sparse from ..problems import ElasticityProblem from .boundary_conditions import MechanismSynthesisBoundaryConditions from ..utils import deleterowcol class MechanismS...
"""Compliant mechanism synthesis problems using topology optimization.""" import numpy import scipy.sparse from ..problems import ElasticityProblem from .boundary_conditions import MechanismSynthesisBoundaryConditions from ..utils import deleterowcol class MechanismSynthesisProblem(ElasticityProblem): r""" ...
en
0.618272
Compliant mechanism synthesis problems using topology optimization. Topology optimization problem to generate compliant mechanisms. :math:`\begin{aligned} \max_{\boldsymbol{\rho}} \quad & \{u_{\text{out}}=\mathbf{l}^{T} \mathbf{u}\}\\ \textrm{subject to}: \quad & \mathbf{K}\mathbf{u} = \mathbf{f}_\...
2.767374
3
tests/test_parse_icao24bit.py
Collen-Roller/arp
2
10475
import unittest from flydenity import Parser class TestParseIcao24Bit(unittest.TestCase): def setUp(self): self.parser = Parser() def test_parse_simple(self): match = self.parser.parse("3D2591", icao24bit=True) self.assertEqual(match, {"nation": "Germany", "description": "general", ...
import unittest from flydenity import Parser class TestParseIcao24Bit(unittest.TestCase): def setUp(self): self.parser = Parser() def test_parse_simple(self): match = self.parser.parse("3D2591", icao24bit=True) self.assertEqual(match, {"nation": "Germany", "description": "general", ...
none
1
3.119133
3
ever/util/_main.py
Bobholamovic/ever
22
10476
import os def create_project(path): dirs = ['configs', 'module', 'data'] dirs = [os.path.join(path, d) for d in dirs] for d in dirs: os.makedirs(d) train_script = r""" import ever as er def train(trainer_name): trainer = er.trainer.get_trainer(trainer_name)() trainer.run() ...
import os def create_project(path): dirs = ['configs', 'module', 'data'] dirs = [os.path.join(path, d) for d in dirs] for d in dirs: os.makedirs(d) train_script = r""" import ever as er def train(trainer_name): trainer = er.trainer.get_trainer(trainer_name)() trainer.run() ...
en
0.677289
import ever as er def train(trainer_name): trainer = er.trainer.get_trainer(trainer_name)() trainer.run()
2.599186
3
src/app/services/metrics_service.py
chrisbpoint/the-app
0
10477
class MetricsService: def __init__(self, adc_data, metrics_data): self._adc_data = adc_data self._metrics_data = metrics_data @property def metrics_data(self): return self._metrics_data def update(self): self._metrics_data.is_new_data_available = False if self....
class MetricsService: def __init__(self, adc_data, metrics_data): self._adc_data = adc_data self._metrics_data = metrics_data @property def metrics_data(self): return self._metrics_data def update(self): self._metrics_data.is_new_data_available = False if self....
none
1
2.641519
3
resthelper/tests/test_build_url.py
rklonner/resthelper
0
10478
import unittest from resthelper.utils import build_restful_url class TestBuildUrl(unittest.TestCase): def test_is_restful_https_url(self): url = build_restful_url('https://jenkins1.tttech.com', 'testuser', '/rest/1.0/request') self.assertEqual(url, 'htt...
import unittest from resthelper.utils import build_restful_url class TestBuildUrl(unittest.TestCase): def test_is_restful_https_url(self): url = build_restful_url('https://jenkins1.tttech.com', 'testuser', '/rest/1.0/request') self.assertEqual(url, 'htt...
none
1
3.033438
3
sendsms/backends/rq.py
this-is-the-bard/django-sendsms
0
10479
""" python-rq based backend This backend will send your messages asynchronously with python-rq. Before using this backend, make sure that django-rq is installed and configured. Usage ----- In settings.py SENDSMS_BACKEND = 'sendsms.backends.rq.SmsBackend' RQ_SENDSMS_BACKEND = 'actual.backend.to.use.SmsBack...
""" python-rq based backend This backend will send your messages asynchronously with python-rq. Before using this backend, make sure that django-rq is installed and configured. Usage ----- In settings.py SENDSMS_BACKEND = 'sendsms.backends.rq.SmsBackend' RQ_SENDSMS_BACKEND = 'actual.backend.to.use.SmsBack...
en
0.642827
python-rq based backend This backend will send your messages asynchronously with python-rq. Before using this backend, make sure that django-rq is installed and configured. Usage ----- In settings.py SENDSMS_BACKEND = 'sendsms.backends.rq.SmsBackend' RQ_SENDSMS_BACKEND = 'actual.backend.to.use.SmsBackend'
2.393128
2
venv/Lib/site-packages/openpyxl/worksheet/errors.py
ajayiagbebaku/NFL-Model
5,079
10480
<gh_stars>1000+ #Autogenerated schema from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, String, Bool, Sequence, ) from openpyxl.descriptors.excel import CellRange class Extension(Serialisable): tagname = "extension" uri = String(allow_none=T...
#Autogenerated schema from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, String, Bool, Sequence, ) from openpyxl.descriptors.excel import CellRange class Extension(Serialisable): tagname = "extension" uri = String(allow_none=True) def __...
en
0.501669
#Autogenerated schema # uses element group EG_ExtensionList
2.477595
2
cwbot/kolextra/request/ItemDescriptionRequest.py
zeryl/RUcwbot
0
10481
<gh_stars>0 from kol.request.GenericRequest import GenericRequest from kol.manager import PatternManager import re class ItemDescriptionRequest(GenericRequest): "Gets the description of an item and then parses various information from the response." _itemIdPattern = re.compile(r'(?i)<!--\s*itemid:\s*(\d+)\s*--...
from kol.request.GenericRequest import GenericRequest from kol.manager import PatternManager import re class ItemDescriptionRequest(GenericRequest): "Gets the description of an item and then parses various information from the response." _itemIdPattern = re.compile(r'(?i)<!--\s*itemid:\s*(\d+)\s*-->') def...
en
0.486876
# Get the item name. # Get the item image. # Get the item type. # Get the autosell value. # See if this is a cooking ingredient. # See if the item is a cocktailcrafting ingredient. # See if the item is a meatsmithing component. # See if the item is a jewelrymaking component. # See if the itemId is listed
2.571438
3
SmartMove/SmartConnector/cpapi/utils.py
themichaelasher/SmartMove
24
10482
import json import sys def compatible_loads(json_data): """ Function json.loads in python 3.0 - 3.5 can't handle bytes, so this function handle it. :param json_data: :return: unicode (str if it's python 3) """ if isinstance(json_data, bytes) and (3, 0) <= sys.version_info < (3, 6): ...
import json import sys def compatible_loads(json_data): """ Function json.loads in python 3.0 - 3.5 can't handle bytes, so this function handle it. :param json_data: :return: unicode (str if it's python 3) """ if isinstance(json_data, bytes) and (3, 0) <= sys.version_info < (3, 6): ...
en
0.390105
Function json.loads in python 3.0 - 3.5 can't handle bytes, so this function handle it. :param json_data: :return: unicode (str if it's python 3) :param: IOError :return: error message
3.056069
3
VokeScan.py
DaduVoke/VokeScan
2
10483
import sys,time def sprint(str): for c in str + '\n': sys.stdout.write(c) sys.stdout.flush() time.sleep(3./90) from colorama import Fore, Back, Style sprint (Fore.RED + "გამარჯობა. tool-ი შექმინლია ლევან ყიფიანი-DaduVoke-ის მიერ @2021") import socket import _thread im...
import sys,time def sprint(str): for c in str + '\n': sys.stdout.write(c) sys.stdout.flush() time.sleep(3./90) from colorama import Fore, Back, Style sprint (Fore.RED + "გამარჯობა. tool-ი შექმინლია ლევან ყიფიანი-DaduVoke-ის მიერ @2021") import socket import _thread im...
none
1
2.771498
3
agent/src/clacks/agent/objects/object.py
gonicus/clacks
2
10484
<filename>agent/src/clacks/agent/objects/object.py # This file is part of the clacks framework. # # http://clacks-project.org # # Copyright: # (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de # # License: # GPL-2: http://www.gnu.org/licenses/gpl-2.0.html # # See the LICENSE file in the project's top-level ...
<filename>agent/src/clacks/agent/objects/object.py # This file is part of the clacks framework. # # http://clacks-project.org # # Copyright: # (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de # # License: # GPL-2: http://www.gnu.org/licenses/gpl-2.0.html # # See the LICENSE file in the project's top-level ...
en
0.7869
# This file is part of the clacks framework. # # http://clacks-project.org # # Copyright: # (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de # # License: # GPL-2: http://www.gnu.org/licenses/gpl-2.0.html # # See the LICENSE file in the project's top-level directory for details. The object base class. # Sta...
1.866216
2
tests/test_benchmark.py
fossabot/BIRL
0
10485
<gh_stars>0 """ Testing default benchmarks in single thred and parallel configuration Check whether it generates correct outputs and resulting values Copyright (C) 2017-2019 <NAME> <<EMAIL>> """ import argparse import logging import os import shutil import sys import unittest try: # python 3 from unittest.mock ...
""" Testing default benchmarks in single thred and parallel configuration Check whether it generates correct outputs and resulting values Copyright (C) 2017-2019 <NAME> <<EMAIL>> """ import argparse import logging import os import shutil import sys import unittest try: # python 3 from unittest.mock import patch...
en
0.754166
Testing default benchmarks in single thred and parallel configuration Check whether it generates correct outputs and resulting values Copyright (C) 2017-2019 <NAME> <<EMAIL>> # python 3 # python 2 # Add path to root # logging.basicConfig(level=logging.INFO) # test missing some parameters # try a missing params # not d...
2.148984
2
python/UdemyCourse/2022_Python_Bootcamp/basics/errors_exception_handling/__init__.py
pradyotprksh/development_learning
9
10486
from .errors_exception_handling import errors_exception_handling
from .errors_exception_handling import errors_exception_handling
none
1
1.097259
1
mtstub.py
shimniok/rockblock
1
10487
<reponame>shimniok/rockblock<gh_stars>1-10 #!/usr/bin/env python ################################################################################################## ## mtstub.py ## ## emulates rockblock api so I don't have to burn credits testing... ######################################################################...
#!/usr/bin/env python ################################################################################################## ## mtstub.py ## ## emulates rockblock api so I don't have to burn credits testing... ################################################################################################## import cgi #i...
de
0.634188
#!/usr/bin/env python ################################################################################################## ## mtstub.py ## ## emulates rockblock api so I don't have to burn credits testing... ################################################################################################## #import cgitb; ...
1.870813
2
sum.py
PraghadeshManivannan/Built-in-Functions-Python
0
10488
<filename>sum.py #sum(iterable, start=0, /) #Return the sum of a 'start' value (default: 0) plus an iterable of numbers #When the iterable is empty, return the start value. '''This function is intended specifically for use with numeric values and may reject non-numeric types.''' a = [1,3,5,7,9,4,6,2,8] ...
<filename>sum.py #sum(iterable, start=0, /) #Return the sum of a 'start' value (default: 0) plus an iterable of numbers #When the iterable is empty, return the start value. '''This function is intended specifically for use with numeric values and may reject non-numeric types.''' a = [1,3,5,7,9,4,6,2,8] ...
en
0.487904
#sum(iterable, start=0, /) #Return the sum of a 'start' value (default: 0) plus an iterable of numbers #When the iterable is empty, return the start value. This function is intended specifically for use with numeric values and may reject non-numeric types.
3.992311
4
idaes/apps/matopt/materials/lattices/diamond_lattice.py
carldlaird/idaes-pse
112
10489
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
en
0.689004
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
2.023895
2
elateridae_baits.py
AAFC-BICoE/elateridae-ortholog-baitset
0
10490
<filename>elateridae_baits.py # coding: utf8 """ Ortholog Based Bait Design Script for creating Elateridae ortholog based baits suitable submission to myBaits Compares t_coffee AA alignment scores with nucleotide tranalignments to find conserved blocks Author <NAME> <EMAIL> License: MIT Copywright: Government of Canada...
<filename>elateridae_baits.py # coding: utf8 """ Ortholog Based Bait Design Script for creating Elateridae ortholog based baits suitable submission to myBaits Compares t_coffee AA alignment scores with nucleotide tranalignments to find conserved blocks Author <NAME> <EMAIL> License: MIT Copywright: Government of Canada...
en
0.816006
# coding: utf8 Ortholog Based Bait Design Script for creating Elateridae ortholog based baits suitable submission to myBaits Compares t_coffee AA alignment scores with nucleotide tranalignments to find conserved blocks Author <NAME> <EMAIL> License: MIT Copywright: Government of Canada Main Function to run Staphylinida...
2.793746
3
poilab.py
octeufer/Annotate_Optimize
0
10491
<filename>poilab.py import sys import numpy as np sys.path.append("d:/data/annooptimize") import triangle import time tinternal = list() def labstart(): points,tri = triangle.gentri("d:/data/annooptimize/Annodata/200600/poise.shp") plabels = triangle.dynamicSize(points) conflictg = triangle.con...
<filename>poilab.py import sys import numpy as np sys.path.append("d:/data/annooptimize") import triangle import time tinternal = list() def labstart(): points,tri = triangle.gentri("d:/data/annooptimize/Annodata/200600/poise.shp") plabels = triangle.dynamicSize(points) conflictg = triangle.con...
none
1
2.497932
2
t_core/tc_python/xrule.py
levilucio/SyVOLT
3
10492
from util.infinity import INFINITY from tc_python.arule import ARule from t_core.rollbacker import Rollbacker from t_core.resolver import Resolver class XRule(ARule): ''' Applies the transformation on one match with roll-back capability. ''' def __init__(self, LHS, RHS, max_iterations=...
from util.infinity import INFINITY from tc_python.arule import ARule from t_core.rollbacker import Rollbacker from t_core.resolver import Resolver class XRule(ARule): ''' Applies the transformation on one match with roll-back capability. ''' def __init__(self, LHS, RHS, max_iterations=...
en
0.726417
Applies the transformation on one match with roll-back capability. Applies the transformation on one match with roll-back capability. @param LHS: The pre-condition pattern (LHS + NACs). @param RHS: The post-condition pattern (RHS). # external_matches_only=True because further matches of this r...
2.289623
2
tests/commonsense/semantic_lexicon_knowledge/ai2_lexicon_test.py
keisks/propara
84
10493
<reponame>keisks/propara<gh_stars>10-100 from unittest import TestCase from propara.commonsense.semantic_lexicon_knowledge.ai2_lexicon import AI2Lexicon, AI2LexiconPredicate, AI2LexiconArg, AI2LexiconIndications, \ AI2LexiconPattern class TestAI2Lexicon(TestCase): def setUp(self): self.lexicon_fp = "...
from unittest import TestCase from propara.commonsense.semantic_lexicon_knowledge.ai2_lexicon import AI2Lexicon, AI2LexiconPredicate, AI2LexiconArg, AI2LexiconIndications, \ AI2LexiconPattern class TestAI2Lexicon(TestCase): def setUp(self): self.lexicon_fp = "tests/fixtures/ie/TheSemanticLexicon-v3.0...
en
0.775765
# print(f"evaporate.subj: {self.lexicon.what_happens_to_subj('evaporate', has_agent=True, has_patient=False)}") # print(f"evaporate.obj: {self.lexicon.what_happens_to_obj('evaporate', has_agent=True, has_patient=False)}") # # print(f"evaporate.subj: {self.lexicon.what_happens_to_subj('evaporate')}") # print(f"evaporate...
2.593966
3
fitbit/__init__.py
erichilarysmithsr/python-fitbit
0
10494
# -*- coding: utf-8 -*- """ Fitbit API Library ------------------ :copyright: 2012-2015 ORCAS. :license: BSD, see LICENSE for more details. """ from .api import Fitbit, FitbitOauthClient, FitbitOauth2Client # Meta. __title__ = 'fitbit' __author__ = '<NAME> and ORCAS' __author_email__ = '<EMAIL>' __copyright__ = 'Co...
# -*- coding: utf-8 -*- """ Fitbit API Library ------------------ :copyright: 2012-2015 ORCAS. :license: BSD, see LICENSE for more details. """ from .api import Fitbit, FitbitOauthClient, FitbitOauth2Client # Meta. __title__ = 'fitbit' __author__ = '<NAME> and ORCAS' __author_email__ = '<EMAIL>' __copyright__ = 'Co...
en
0.358271
# -*- coding: utf-8 -*- Fitbit API Library ------------------ :copyright: 2012-2015 ORCAS. :license: BSD, see LICENSE for more details. # Meta. # Module namespace.
1.103585
1
bitcoinExchange/exchange/api/urls.py
pogginicolo98/start2impact_exchange
1
10495
<reponame>pogginicolo98/start2impact_exchange from django.urls import include, path from exchange.api.views import LatestOrdersListAPIView, OrderViewSet, ProfileAPIView from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'orders', OrderViewSet, basename='orders') urlpatterns = [...
from django.urls import include, path from exchange.api.views import LatestOrdersListAPIView, OrderViewSet, ProfileAPIView from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'orders', OrderViewSet, basename='orders') urlpatterns = [ path('profile/', ProfileAPIView.as_view()...
none
1
1.979356
2
python/testData/formatter/indentInGenerator_after.py
jnthn/intellij-community
2
10496
def dbl(): return ( (a, a) for a in [])
def dbl(): return ( (a, a) for a in [])
none
1
1.655636
2
kevin/aggregate/process_html.py
toddoh/thisisallabout_backend
0
10497
from bs4 import BeautifulSoup import requests import re def retrieveText(): print("Parsing text from online target") url = "https://www.whitehouse.gov/the-press-office/2017/10/16/remarks-president-trump-and-senate-majority-leader-mitch-mcconnell-joint" response = requests.get(url) soup = BeautifulSoup(...
from bs4 import BeautifulSoup import requests import re def retrieveText(): print("Parsing text from online target") url = "https://www.whitehouse.gov/the-press-office/2017/10/16/remarks-president-trump-and-senate-majority-leader-mitch-mcconnell-joint" response = requests.get(url) soup = BeautifulSoup(...
en
0.396912
# print(textstripped)
3.478917
3
cfmacro/_resources/examples/lambda.py
gchiesa/cfmacro
0
10498
<reponame>gchiesa/cfmacro<filename>cfmacro/_resources/examples/lambda.py # -*- coding: utf-8 -*- from cfmacro.processors import SgProcessor from cfmacro.core.engine import ProcessorEngine from cfmacro.core.template import TemplateProcessor def lambda_handler(event, context): """ Implement a core handler for ...
# -*- coding: utf-8 -*- from cfmacro.processors import SgProcessor from cfmacro.core.engine import ProcessorEngine from cfmacro.core.template import TemplateProcessor def lambda_handler(event, context): """ Implement a core handler for security groups ingress / egress :param event: :param context: ...
en
0.649537
# -*- coding: utf-8 -*- Implement a core handler for security groups ingress / egress :param event: :param context: :return:
1.929878
2
tf2qa/predict_long.py
mikelkl/TF2-QA
17
10499
<reponame>mikelkl/TF2-QA<gh_stars>10-100 import torch import argparse from roberta_modeling import RobertaJointForLong from transformers.modeling_roberta import RobertaConfig, RobertaModel from torch.utils.data import TensorDataset, SequentialSampler, DataLoader import utils from tqdm import tqdm import os import json ...
import torch import argparse from roberta_modeling import RobertaJointForLong from transformers.modeling_roberta import RobertaConfig, RobertaModel from torch.utils.data import TensorDataset, SequentialSampler, DataLoader import utils from tqdm import tqdm import os import json import collections import pickle import p...
en
0.302535
# Convert to Tensors and build dataset :param entry: dict :return: str # if entry["short_answers_score"] < 1.5: # return "" # if entry["long_answer_score"] < 1.5: # return "" # Eval! # all_results = pickle.load(open(os.path.join(args.output_dir, 'RawResults_test.pkl'), 'rb')) # make_submission(output_pr...
2.117392
2